Jump to content
Changes to the Jaspersoft community edition download ×

JRViewer in Landscape mode  


Recommended Posts

By: Don - nigdon

JRViewer in Landscape mode Â

2006-01-09 19:37

I'm programmatically creating reports for a Java desktop application (linked to PostgreSQL). The application allows the user to set the page orientation as they see fit. No matter what I do, I am unable to get JRViewer to respond to the user's wishes, and display a report in Landscape mode.Â

Â

I'm sure it's possible, so what am I doing wrong?! Please help.Â

Â

The key lines from my program follows:Â

---Â

Â

jasperDesign = new JasperDesign();Â

Â

...Â

Â

jasperDesign.setOrientation(JRReport.ORIENTATION_PORTRAIT);Â

Â

...Â

Â

// Compile the report.Â

jasperReport = JasperCompileManager.compileReport(jasperDesign);Â

Â

...Â

Â

// Fill the report.Â

jasperPrint = JasperFillManager.fillReport(jasperReport, (java.util.Map)null, OHStatApp.getDatabaseConnection());Â

Â

...Â

Â

jasperPrint.setOrientation(JRReport.ORIENTATION_LANDSCAPE);Â

Â

...Â

Â

// Create a viewer object...Â

viewer = new JRViewer(jasperPrint);Â

// ...and add it to the JInternalFrame.Â

this.getContentPane().add(viewer, BorderLayout.CENTER);Â

 

 

 

 

 

By: Lucian Chirita - lucianc

RE: JRViewer in Landscape mode Â

2006-01-10 07:29

The report orientation is only used for printing.Â

Â

When you want a landscape report, you should set the report width as the print page height and the report height as the print page width. Check the landscape sample under the demo folder.Â

Â

HTH,Â

Lucian

 

 

 

By: Don - nigdon

RE: JRViewer in Landscape mode Â

2006-01-10 14:11

Well, I'd done that. To no avail, it seemed. However, a new day brings a fresh perspective, and I've just discovered that the problem was due to a sloppy cut/paste edit. Sorry for wasting your time.Â

Â

NDÂ

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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