Hi
Is there a method to get the current page number?
so i could keep track of which page a particular section starts on.
Regards
Get the current page number
Re: Get the current page number
Forum member · Jan 11, 2006bit more info,
i mean get the page number while building a table which is overflowing.
Regards
Re: Get the current page number
Support · Jan 11, 2006You can use the Document.PageCount property for this. After adding the first page this value will be one, after adding the second page this value will be two, etc.
Thanks,
ceTe Software Support Team
Re: Get the current page number
Forum member · Jan 11, 2006Thanks for the reply,
the problem is that i'm using a table which is generated from a recordset and can be 20 pages.
The PageCount property is fine until i have to use the GetOverflowRows() method of the table, at this point i can't tell which section is being added to which page. What i need is to be able to add new pages at the same time as generating the table, can you suggest any othet way?
Regards
Re: Get the current page number
Support · Jan 11, 2006You should be adding the overflow table to the page as you are retrieving it. If you are doing this, then using Document.PageCount to get the current page should work fine. If you continue to have problems, post the table overflow code and we'll take a look at it and point you in the right direction.
Thanks,
ceTe Software Support Team
Re: Get the current page number
Forum member · Jan 11, 2006Hi thanks for the reply,
this is the overflow code:
Do
Set MyOverflowTable = MyTable.GetOverflowRows()
If Not( MyOverflowTable Is Nothing ) Then
Set MyPage = MyDocument.AddPage()
Set MyTable = MyPage.AddOverflowTable( MyOverflowTable )
'strIndex = strIndex & MyDocument.PageCount & ","
End if
Loop While Not( MyOverflowTable Is Nothing )
The problem is that this is after i have produced the table in the recordset, so i don't have any idea which section (from the database) is on which page.
Re: Get the current page number
Support · Jan 11, 2006If you are using a new table in each section then the Document.PageCount property for this. If all of the sections are in the same table and the table uses overflow, it will not be possible to get the page numbers for each section, only the page number for the beginning of the table. We'd recommend using a new table for each section as this will give you more flexiblilty.
Thanks,
ceTe Software Support Team
Re: Get the current page number
Forum member · Jan 11, 2006so does a new table always start on a new page?
Regards
Re: Get the current page number
Support · Jan 11, 2006No, you have control over where to place the table. You can add it to a new page or in the remaining room at the bottom of the current page.
You can use the GetRequiredHeight method of the final table in your calculation to determine the new tables location if you want to place it on the same page as the previous table.
Thanks,
ceTe Software Support Team
Re: Get the current page number
Forum member · Jan 11, 2006Thanks for your help here,
so if i create a table then get the required height i can then check if there is enough space on the page to put the current table or i create a new one, what do i check the space on a page with?
Regards
Re: Get the current page number
Support · Jan 11, 2006Yes, that is correct.
Usually you will know the page height before hand so you can hard code the value. If not, you can use:
BodyHeight = MyPage.PageHeight - MyPage.MarginTop - MyPage.MarginBottom
To get the amout of room left on the page:
HeightRemaining = BodyHeight - MyTable.Y - MyTable.GetRequiredHeight()
Thanks,
ceTe Software Support Team