Menu

#45 Excel/CSV multi page reports have multi column headers

open
5
2012-12-07
2009-12-17
No

So I've been following the how-to http://dynamicjasper.sourceforge.net/docs/HOWTO%20Create%20an%20Excel%20report.html

ds.moveFirst();
FastReportBuilder drb = createGenericJRDesign(reportTitle, ((NNTable) table).getNNTableModel());
drb.setPrintColumnNames(true);
drb.setIgnorePagination(true);
cleanJP = DynamicJasperHelper.generateJasperPrint(drb.build(), new ListLayoutManager(), ds,
parameters);

This results in an xls/csv file where the column headers appear multiple times (instead of just one). So then, I tried setting the JRParameter explicity in the parameters.
....
parameters.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
cleanJP = DynamicJasperHelper.generateJasperPrint(drb.build(), new ListLayoutManager(), ds,
parameters);

Voila! everything seems fine now. Am I missing something here? I'm using 3.0.8 of DJ along with 3.5.1 of JR. Any suggestions?

Discussion

  • Fahim Abdun-Nur

    Fahim Abdun-Nur - 2009-12-17
     
  • Fahim Abdun-Nur

    Fahim Abdun-Nur - 2009-12-17
     
  • Fahim Abdun-Nur

    Fahim Abdun-Nur - 2009-12-17

    JDK 1.5.0.22

    Without the explicit parameter = test.xls (multi headings)
    Explicit = test2.xls (correct)

     

Log in to post a comment.

MongoDB Logo MongoDB