Page Number

DynamicPDF ReportWriter for COM/ActiveX (v1) Forum

 Mar 18 2006 1:50 PM
Wondering if you could help me with this...

I am using report writer via odbc.. anyhow

I am trying to create an account statement, all is well, except, I am trying to show an "opening balance" for the first line on the statement.  I have achieved this in the header object before I query transactions in the body object. 

However, approaching this via the header object makes the opening balance list on every page of the statement.  How do I reference the current page and total pages within ASP code.  If this is possible I can limit my "opening balance" line to only show on the first page with a simple "if" statement. 

Thanks for the help in advance...
 Mar 20 2006 9:52 AM
Posted by a ceTe Software moderator
Hello,

You can get the current page number and total number of pages using the Parse property of the Label or TextArea object.

Set objLabel = .AddLabel("Pagina %CP% de %TP%", 0, 0, 504, 12, DPDF_Align_Right, DPDF_Font_HelveticaBold, 12)

objLabel.Parse = True

Thanks,
ceTe Software Support Team
 Mar 20 2006 10:43 AM
I dont think you understand my question.  I am NOT looking to DISPLAY the page number I already do that. 

How would I assign the pagenumber to an ASP variable(integer) that I could reference in my code.
 Mar 20 2006 11:26 AM
Posted by a ceTe Software moderator
Hello,

You can use the PageCount property of the Document object to get the current number of pages that have been added to the document and assign that value to an ASP integer.

If you want to navigate to a page that has already been added earlier, then you will have to use some sort of counter to keep track of it.

Thanks,
ceTe Software Support Team
 Nov 16 2006 2:49 PM
'PageCount' is not a member of 'ceTe.DynamicPDF.Document'.

?????????
 Nov 16 2006 3:16 PM
Posted by a ceTe Software moderator
Hello,

There is no PageCount property available in the ReportWriter product. The PageCount property belongs to Document object in the Generator product.

Thanks,
ceTe Software Support Team

 Nov 16 2006 3:37 PM
That explains it.  Thanks. 

I want to print information only if it's the first page.  With the ReportWriter product, how can that be done?
 Nov 16 2006 4:11 PM
Posted by a ceTe Software moderator
Hello,

I am sorry for my previous post. Actually you can get the value of PageCount using the Document property of the Report object. Sample line of code:

value = objReport.Document.PageCount

So using the above derived value you can find out if you are on first page or not.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 3:29 AM.