ExcelGenerator and ExcelSheetGenerator Classes
Exporting a report to an Excel file is performed through 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"). The page size can be changed using setPageSize() in ReportSheet. This call must be made before the generate() method is invoked.
When exporting a large file to Excel, note that an Excel spreadsheet has a maximum of 65535 rows and 255 columns; a report should not exceed these limits. Also, the heap size of the JVM needs to be increased. Use Java -XmxbbbM to indicate the maximum (where maximum JVM size is Xmx and JVM heap size is bbbM). For example:
java -Xmx192M TestCase
Exporting to Different Excel Versions
The ExcelGenerator allows for export to particular types of Excel Files such as Excel 2000, Excel 95, or an Excel Spreadsheet with no page breaks for easier data manipulation (as opposed to being used in a presentation). To use this feature, instantiate the ExcelGenerator by sending the version parameter as follows:
//Excel 2000
ExcelGenerator gen =
ExcelGenerator.createExcelGenerator(
new FileOutputStream("report.xls"),
ExcelGenerator.EXCEL2000);
//Excel 95
ExcelGenerator gen =
ExcelGenerator.createExcelGenerator(
new FileOutputStream("report.xls"),
ExcelGenerator.EXCEL95);
//Excel with no page breaks
ExcelSheetGenerator gen =
ExcelSheetGenerator.createExcelGenerator(
new FileOutputStream("report.xls"),
ExcelGenerator.EXCEL_SHEET);
Copying or Pasting Content in the Generated Excel File
When copying and pasting the contents of the generated Excel file between two spreadsheets, make sure that both spreadsheets use the same formatting. If the two Excel files (source and target) use different cell formatting, a few problems may arise. In this case, try using 'Paste Special' instead of paste and select only the value or content, but not the format. If Windows XP is used, then open the clipboard by selecting Edit → Office Clipboard. Choose 'select using destination format'.
When you export a CSV file to excel, special characters are encoded in UTF8 format, which might provide an inaccurate representation of the report. You can set the property “text.encoding.utf8” in the sree.properties file to “false”. This will ensure that special characters are not encoded into UTF8 during export. The default value of this property is true. Another property is “text.break.pages” which, when set to “true”, will insert a form feed at every page break.
More Articles Abouut Dashboarding
Aerospace Company Weekly Reports - Management at an aerospace company typically wants to see a comprehensive overview of key performance indicators (KPIs) and critical updates that reflect the company's operational, financial, and strategic status. A weekly report serves as a valuable tool for keeping stakeholders informed and aligned with the company's goals and objectives. Here's a breakdown of what management at an aerospace company might want to see in their weekly report: Financial Performance: Revenue and Sales: Breakdown of revenue generated during the week, including any significant changes compared to previous weeks. Cost Analysis: Overview of major expenses, such as production costs, R&D, and overheads...
Autonomous BI Teams - I think you are going to find that some of your business intelligence teams are almost completely autonomous. Business intelligence managers have really good skill sets, they know how to integrate and analyze and report data and they kind of want to run on their own. Other decentralized teams you may have are going to need you to hold them by the hand and sort of walk them through everything. So see what kind of hand you have been dealt and draw this picture of your organization...
Balanced Scorecard Stretch Targets - You need to set stretch targets at each level of your balanced scorecard, and by all means, if somebody meets the stretch target, you better celebrate the success. That is something great. And I always work with managers, and I keep telling them you should focus two-thirds of your time on emphasizing the good, and only one-third of the time in those things where you need further improvement, because that will really drive your people Your people will stand behind you like one if you are going to do that. And that's a tough thing. I work with organizations where there are a lot of engineers, and I am an engineer myself. Engineers are a really peculiar bunch...
Evaluate InetSoft's Analytics for Performance Management - Are you looking for analytic tools for performance management? InetSoft offers a Web-based solution that is easy and intuitive. InetSoft is top-rated by users on G2 Crowd. Interact with examples and register for a personalized demo...
How to Create an Intranet Dashboard - Creating an intranet dashboard with InetSoft is extremely simple, and can be achieved by ordinary business users without any special programming or IT support. The three basic steps are to connect to your data sources, add components to your dashboard, and then use the dashboard anytime, anywhere. The following section will walk through these easy steps: 1. Connect to your data InetSoft makes it easy to connect to your business data sources, whether they are relational databases such as Oracle or SQL Server, or something as simple as an Excel spreadsheet or text file. Dozens of data source connections are built-in, and custom data sources can be easily connected...
Options for Ad Hoc Reporting Software - Wizard-guided report creation and free-form editing Aggregate, grouping, filtering Report layout and presentation element library Security restrictions automatically applied With InetSoft's Technology, business managers are able to create sophisticated reports that can easily be deployed for server-based, or desktop-based applications. Style Report Enterprise offers a user-friendly GUI simple enough for any user to access...