Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Table with many rows - many pages |
Post Reply
|
| Author | |
Slawek
Beginner
Joined: 05 Aug 09 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: Table with many rows - many pagesPosted: 05 Aug 09 at 8:19AM |
|
Hi
I have table with 1000 rows TabId:= CreateTable(1000, 5); SetTableRowHeight(TabId, 1, 1000, 0); ... I need draw table on many pages so I do something like this: aPageCount := 0; repeat DrawTableRows(TabId, 0.2, PageHeight - 0.2, PageHeight - 0.4, aPageCount + 1, FPDFApp.GetTableLastDrawnRow(TabId)); aRowPage := GetTableLastDrawnRow(TabId); //aRowPage = 50 Inc(aPageCount,aRowPage); if aPageCount < 1000 then SelectPage(NewPage); until aPageCount >= 1000; But it isn't working, I have many pages but table is only on first page with first 50 rows. How I can draw table on next page? |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 Aug 09 at 9:33AM |
|
Hi!
I don't see that "NewPage" is served? SelectPage(aPageCount) should work. If you want to create 1000 pages with a table and your document doesn't have these 1000 pages then you have to create them ... in this case have a look at "NewPage". What you can do, too is creating the table one time and copy this single page on the other pages. Have a look in the page management functions of QuickPDF. Cheers, Ingo |
|
![]() |
|
Slawek
Beginner
Joined: 05 Aug 09 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 Aug 09 at 12:24PM |
|
I want print 1000 rows on X pages. On one page I can print about 50 rows (sometimes 40 or 60, GetTableLastDrawnRow result).
I create new page and select it here: if aPageCount < 1000 then SelectPage(NewPage); aPageCount - it's total row count from first page to current: page - aPageCount 1 - 50 rows (from 1 to 50) 2 - 100 (from 51 to 100) 3 - 150 (from 101 to 150) ... when aPageCount >=1000 I finish. After that I have 20 pages but only first have table, other are clear. I think when I do DrawTableRows(TabId, 0.2, PageHeight - 0.2, PageHeight - 0.4, aPageCount + 1, GetTableLastDrawnRow(TabId)); table is draw on currently selected page. Is this true? |
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 Aug 09 at 9:31PM |
|
Hi!
What's the returning value from "SelectPage(NewPage);"... error or okay? In your loop you can try something like: // ... QP.NewPage; QP.SelectPage(aPageCount); // ... now your table // ... Cheers, Ingo |
|
![]() |
|
Slawek
Beginner
Joined: 05 Aug 09 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 Aug 09 at 6:22AM |
|
>QP.NewPage;
>QP.SelectPage(aPageCount); > I don't do aPageCount := QP.NewPage aPageCount - isn't a new page id, it should be aPrintedRecordCount, it's total row count from first page to current SelectPage it's ok I know what it's wrong: GetTableLastDrawnRow returns last printed row, not rowcount from last page. It should be: DrawTableRows(aTableId, 0.2, PageHeight - 0.2, PageHeight - 0.4, aPrintedRecordCount + 1, 0); aPrintedRecordCount := GetTableLastDrawnRow(aTableId); //not Inc(aPrintedRecordCount ,GetTableLastDrawnRow(aTableId)); ... Thank you very much for help. |
|
![]() |
|
Michel_K17
Newbie
www.exp-systems.com Joined: 25 Jan 03 Status: Offline Points: 297 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 Aug 09 at 3:31PM |
|
Great job Slawek! Thanks for posting an update.
|
|
|
Michel
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store