Jump to content
We've recently updated our Privacy Statement, available here ×

JasperPrintManager.printReport fit to page


Recommended Posts

Hello. I have a problem when I try to print a Jasper PDF.

If I use the JRPdfExporter function, I have a problem trying to display the print box using the following code

JRPdfExporter exporter = new JRPdfExporter();exporter.setParameter(JRPdfExporterParameter.PDF_JAVASCRIPT, "this.print({bUI: true,bSilent: false,bShrinkToFit: true});");   exporter.exportReport(); [/code]

 

The problem I have in this example is that the print dialog is not shown in internet explorer. I have already verified that the problem is caused when protected mode is enabled in both internet explorer and adobe acrobat. The problem is that I cannot ask all the users of the application to disable that option.

After encountering this error I tried to program my function in another way, using the following code

JasperPrint print = null;print = JasperFillManager.fillReport(url.getPath(), datosListado, srDs);JasperPrintManager.printReport(print, true);[/code]

The problem I have when doing it this way is that the width of the report in the jrxml file is greater than the print size and the text is cut off. I cannot change the template because it is common to multiple processes. Could it be adapted depending on the size of the printer sheet?

 

Thanks

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...