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

Pdf report ignoring page orientation setting…..


manishamauni

Recommended Posts

Hello,

I am using same JasperPrint instance for creating my report in html format and pdf format using

JasperExportManager.exportReportToHtmlFile(jasperPrint, "test/MainReport.html" ); and

JasperExportManager.exportReportToPdfFile(jasperPrint, "test/MainReport.pdf") functions respectively.

 

 

I can print my html report both in portrait and landscape orientation while I am not able to do so for pdf report.

I tried setting JRReport.ORIENTATION_LANDSCAPE but it’s just ignoring the setting.

 

I want to give user flexibility of printing pdf report in portrait as well as landscape….

 

Please help…..

 

Thanks

Manisha

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

Changing page orientation is not sufficient.

It is actually a page size change. The page width should become the page height and viceversa.

The orientation attribute is used only by some exporters (including the PDF exporter) that need to know the document is in landscape format so that printer turns the page when printing.

 

Having said all that, I'm not sure what you are trying to achieve is possible, since PDF is an absolute positioning layout and by only changing the page orientation, the content will not adapt automatically to fit into a wider page layout.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

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...