I have a custom container class I call superpreview, which has pdf viewer and a container I use to preview reports
The funny thing is, the report preview is not resetting the page number
So each time the preview is reloaded it increments the page numbers by the amount of pages
Even funnier, it seems to be storing the page number some where in memory, because if I close the forms, then open again, the page number has not reset
This only applies to this preview container. If I preview in a standard VFP report form then the page number is OK
I am using _pageno in the report to show the page number
Here is the code that I use to paint the report to the container:
The references to page number provides the page number and count to a method in the container which displays "Page # of Total" in the preview container's tool bar
This is working OK
Any ideas people?
The funny thing is, the report preview is not resetting the page number
So each time the preview is reloaded it increments the page numbers by the amount of pages
Even funnier, it seems to be storing the page number some where in memory, because if I close the forms, then open again, the page number has not reset
This only applies to this preview container. If I preview in a standard VFP report form then the page number is OK
I am using _pageno in the report to show the page number
Here is the code that I use to paint the report to the container:
Code:
****************************************************************
lcReport="AnnualReport_Ancil"
LnOrion=1 && Landscape
lcMethodname="previewreport"
****************************************************************
IF lcMethodname<>thisform.superpreview1.methodname && New Run
thisform.superpreview1.methodname=lcMethodname
thisform.superpreview1.firstrun=.t.
ELSE
thisform.superpreview1.firstrun=.f.
ENDIF
thisform.superpreview1.setreporttype(0)
thisform.superpreview1.orientation=LnOrion
thisform.superpreview1.setorientation
rl=thisform.superpreview1.previewcont1.listenerref
REPORT FORM &lcReport. OBJECT rl NORESET
lcRec=rl.OutputPageCount
thisform.superpreview1.previewcont1.totalpages=lcRec
lcPAge=thisform.superpreview1.previewcont1.pageNo
IF lcPage>lcRec
lcPAge=lcRec
ENDIF
IF thisform.superpreview1.firstrun=.t.
lcPage=1
ENDIF
thisform.superpreview1.updatepagecnt(lcPAge,lcRec)
* Render page 1 to the target:
WAIT "" WINDOW AT 2,2 TIMEOUT .005
rl.OutputPage( lcPage, thisform.superpreview1.Previewcont1, 2 )
****************************************************************
The references to page number provides the page number and count to a method in the container which displays "Page # of Total" in the preview container's tool bar
This is working OK
Any ideas people?