Data Access Worldwide Knowledge Base

Article ID 2093
Article Title INFO: Retrieving the Current page number of winprint report
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2093
KBase Category VDF11
Date Created 03/03/2005
Last Edit Date 03/08/2005


Article Text
QUESTION:
How do you access the current page number?

ANSWER:
That is a good question.

Move '#pagecount#' to iCurPage will definitely not work. To DataFlex, '#pagecount#' is just a string. It is when you pass this string to a report that the WinPrint engine substitutes the string for the current page number that it is maintaining internally. It does not work the other way.

I will have to think about this. It should be possible in the Body section of your report to always be able to ask WinPrint what the current page number is. That is because the body section gets executed during the creation of each page. But in the Header, Footer sections etc I am not so sure.

The problem is that this VDF code is executed independantly, or semi-independantly sometimes of each occurance of the section's output on a page. WinPrint buffers these sections and repeats their output at the appropriate moment without having to execute any VDF code. That is why these special symbols are needed to tell WinPrint that you want a page number printed there each time the buffered section is rendered to a page.

This buffering technique is used because otherwise the WinPrint engine would need some way to call back to a VDF program to tell it which code to execute to generate the appropriate sections for the report at each point they are needed. This can vary tremendously for the exact same report depending on which printer, paper size, orientation, etc the report it is being printed on so it can never be predicted by the actual VDF program.

In any case, for VDF 11.0 there is no way I know to retrieve the current pagenumber of a WinPrint Report to your VDF application. This would have to be a requested feature for a future release.



Contributed By:
John van Houten
Company: Data Access Worldwide
Web Site: http://www.dataaccess.com


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.