ExcelGenerator and ExcelSheetGenerator Classes

To export a report to an Excel file, use the ExcelGenerator and ExcelSheetGenerator classes.

ExcelGenerator gen =

   ExcelGenerator.createExcelGenerator(

      new FileOutputStream("report.xls"));

gen.generate(report);

The default page size is the standard letter size (8.5"x11"). To change the page size, call setPageSize() in ReportSheet before you invoke the generate() method.

The report length should not exceed the limits of the Excel spreadsheet. Also,

you may need to increase the heap size of the JVM. Use java -XmxbbbM to indicate the maximum (where maximum JVM size is Xmx and JVM heap size is bbbM). For example:

java -Xmx192M TestCase

When you export a CSV file to Excel, special characters are encoded in UTF8 format, which might provide an inaccurate representation of the report. In this case, set the text.encoding.utf8 property in sree.properties to false to ensure that special characters are not encoded into UTF8 during export. To insert a form feed at every page break, set text.break.pages to true.

<< 3.8.2 Exporting to Excel Format Programmatically © 1996-2013 InetSoft Technology Corporation (v11.5) Different Excel Versions >>