3
DynamicReport firstDynaRep = new DynamicReport();
firstDynaRep.setTemplateFileName("./landscape.jrxml");
firstDynaRep = firstReport.build();

DynamicReport not taking it as a template. So the width of the page is not increased. So is there any way to increase the width of the page in dynamicjasper report? (I want the report in landscape orientation.)

chetan
  • 3,175
  • 20
  • 72
  • 113

3 Answers3

2

Modify page size and orientation.

DynamicReportBuilder drb = new DynamicReportBuilder();
drb.setPageSizeAndOrientation(Page.Page_A4_Landscape());

OR

int w = ???
int h = ???
boolean portrait = false;
drb.setPageSizeAndOrientation(new Page(h, w, portrait);
Braully Rocha
  • 1,364
  • 2
  • 16
  • 22
0

Page page = new Page(); page.setOrientationPortrait(false);

This will bring up the page in landscape mode

satish
  • 41
  • 3
0

I haven't used DynamicJasper for a long time, but I believe you should be using setTemplateFileName() on a DynamicReportBuilder and not on DynamicReport

DynamicReportBuilder drb = new DynamicReportBuilder();
drb.setTemplateFile("./landscape.jrxml");
DynamicReport firstDynaRep = drb.build();
Giorgos Dimtsas
  • 12,019
  • 3
  • 29
  • 40
  • I am used FastReportBuilder. I check the code just you specified ,but its not working with FastReportBuilder. – chetan Sep 25 '10 at 03:57