Printing a specific page from a report

I have done a report screen using the reporting plug in. When it returns data there is more than one page of information. As you know at the bottom of the report is arrows where you can scroll thru the various pages.

What I am wondering is if there is an easy script of something that i could place in a button to print only the selected and shown page of the report?

thanks and have a great day, :prayer:

You can invoke a print function on the Report Viewer component in code, but you cannot tell it which page to print. That is up to the user on the print dialog box that pops up. A user can select a page or set of pages to print.

So basically there is no way to print say the current displayed page of a report other than typing in to the print dialog box the page number? Or maybe being able to send the current page number from the report viewer/FPMI over to the print dialog box and having it automatically filled in?

Has no one a script or anything that can accomplish the task? Or any suggestion on how to accomplish the task? Other than using the print dialog box settings?

After some amount of time and some thought I have come up with a “somewhat” solution. The reason I call it a somewhat solution is because I can not seem to control the print direction. Here is what I have in a code under a button

[code]table = event.source.parent.getComponent(“Report1”)
job = fpmi.print.createPrintJob(table)

job.setMargins(0.01)

job.showPageFormat = 0
job.print.LANDSCAPE
job.print()[/code]

I have tried setting both fpmi.print.PORTRAIT and fpmi.print.LANDSCAPE and no matter what i set there the print always comes out portrait. So what am I missing to change the print over to LANDSCAPE??

Thanks and have a great day.

Martin,

Here is a quick and dirty, proof-of-concept, aka hack of a solution.

You’ll need to download “pdftk” from here: http://www.accesspdf.com/pdftk/

You’ll also need a PDF reader like Adobe Reader or Foxit Reader to actually do the printing.

The button script is very crude and you’ll need to clean it up and generalize it for a production application.
PrintPDFPages.fwin (13.2 KB)