Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Current Page in CRViewer 2

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
0
0
GB
I have a Delphi 5 application that makes use of the CRViewer component. Can anyone suggest a way in which I can allow the user to print the current page in the preview pane ? For instance the user may be looking at page 10 of 100 and want only to print this page. I want to allow the user to hit a button and print this page. If they click the standard print button they can enter the current page number in the To/From range but ideally I would like to default this if possible.
Am I missing the obvious ?
Thanks in advance.
Steve
 
Steve,
that would be such a useful feature, but I don't think it is possible. If you do figure a way to do this, please post here (I've flagged it).

Malcolm
 
Steve,

I'm assuming that you are using the RDC in your app. You can create your own 'Print current page' button and do the following when the user selects this button.

The GetCurrentPageNumber method of the CRViewer object returns the current page number of the report being viewed.

You can use the page number returned to pass into the StartPageNumber and StopPageNumber arguments for the PrintOut method for your report object.

The first arguement of the PrintOut method is PromptUser, and you could set this to false so that the user is not prompted to set print options.

Be sure to also select a printer using the report's SelectPrinter method before you call the PrintOut method.

Diane
 
Diane : Thanks for the solution to this one - I have now been able to provide users to only print the currently viewed page.
Thanks again.
Steve
 
The suggestion made worked fine - however I am now looking at attempting the same situation (printing the currently previewed page) and want to print the page that is currently being viewed even if Drilled Down. I have drill-down groups set up in the reports. If I have drilled down to the group level (such that I open the pages associated with the group in question - for instance a customer) and am viewing page 3 within this group when I select to print the current page - I am given page 3 of the whole report (details not associated with drilled down customer group). Is there a way to determine the page number of the drilled down group page being viewed in relation to the entirity of the report ?
Thanks in advance,
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top