#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index |
|
Read More |
Exporting a Report to HTML Format
For Web-based applications, HTML has become a popular way to present reports. While it is straightforward to generate text-based HTML directly, adding other elements, such as charts, to HTML is not as easy. The HTML exporting feature in InetSoft products allows a regular report to be converted to HTML with almost no extra coding, so you can build one report and have an option to present/print it with the InetSoft classes or send it to a browser as an HTML file.
The HTML exporting facility uses only the basic HTML commands in HTML 3.0. This ensures compatibility with as many browser versions as possible. Because HTML does not have many of the formatting capabilities that Style Intelligence has, the generated HTML may lose some formatting information that is in the actual report.
As part of the HTML generation process, the builder may need to generate additional files that are used inside the HTML file. This is true for any non-text elements, such as charts, images, etc…
FileOutputStream os = new FileOutputStream(filename);
Builder builder = Builder.getBuilder(Builder.HTML, os, ".");
builder.write(sheet);
os.close();
While the Builder can be used to get the appropriate Builder for HTML generation, the HTMLGenerator performs the generation and is found in the inetsoft.report.io package.
Image Files
The extra parameter in the getBuilder() call specifies the directory in which to place the additional image files. If it is omitted, it defaults to the current directory. Image files are produced as PNG or JPEG files. PNG images are smaller in file size and are often of better quality than JPEG, however PNG is only supported by version 4.0 browsers and higher.
ReportEnv.setProperty("image.type", "png");
//or
ReportEnv.setProperty("image.type", "jpeg");
If an image element in the report uses a URL for image location, no image file will be generated. Instead, the specified URL is placed in the generated HTML as the image location.
Exporting an HTML
Bundle An HTML Bundle consists of a zip file, which contains the generated HTML report as well as all associated image files. To generate an HTML Bundle, first create an OutputStream, which will be used by the Builder. The next step is to get the Builder to generate the HTML Bundle.
FileOutputStream os = new FileOutputStream(filename);
Builder builder = Builder.get
Builder(Builder.HTML_BUNDLE, os, ".");
builder.write(sheet);
The HTML Bundle is generated by the Builder class using the inetsoft.report.io.HTMLFormatter. The Builder seamlessly takes care of writing to the ZipOutputStream. Setting the property on ReportEnv as described above also controls the type of image file, JPEG or PNG.
Setting the DHTML Meta-Data Information
DHTML meta-data can be set for a ReportSheet before exporting the report to HTML. The following properties may be set:
report.title
report.subject
report.author
report.keywords
report.comments
report.created
report.modified
The properties can be set in the following way:
ReportSheet report = new TabularSheet();
report.setProperty("report.title", "Hello");
More Articles About Dashboarding
Benefits Manager Dashboards - Benefits Program Performance Monitoring: Dashboards help benefits managers track the performance of the organization's benefits programs. Key metrics such as enrollment rates, employee participation, usage of different benefits (e.g., healthcare, retirement plans, wellness programs), and costs can be displayed in real-time, allowing the manager to identify trends, successes, and areas for improvement...
Differences Between Visualizations and Dashboards - There are several significant variations between visualizations and dashboards, despite the fact that both convey data visually. Purpose Data presentation in an understandable manner is the fundamental goal of a visualization. In order to spot patterns, trends, and correlations in the data that may not be immediately apparent from a spreadsheet or database, visualizations are often utilized. They may be used to streamline complex data sets, enhancing accessibility for a larger audience...
Do You Find Self-hosted BI Is Cost Prohibitive? - Bring BI software to your data to deliver real-time data and high performance InetSoft allows you to choose hosting without a huge cost penalty over vendor hosting Explore the live dashboard & report gallery to see what you can provide your end users. Free Best Practice Guidance Backed by real-world experience, we will help you speed up your deployment...
Information Management Implementation Stages - There are several stages of the information management implementation process. Most consulting firms and vendors prescribe this kind of methodology. They might call it something different, but for the most part, the five bases are A, project planning, B, application exploration, C, system design, D, system testing and E system activation. I'll just talk a little bit about each one. In the project planning, it's exactly what it sounds like. You are putting together a form of plan. You are picking dates. You are assigning resources, and you are making sure that everything makes sense...
KPI Reports in a Fleet Management Dashboard - A fleet management system comes up with a lot of day-to-day data and statistics which you can easily check by logging to your fleet management dashboard. There are multiple KPI reports and data sets which can help you make better decisions as a fleet manager. Some of them are: Account Info and Vehicle Details This section will give you entire data about your list of vehicles which you are managing in your fleet, along with the IMEI and the device type used in the respective vehicles. This will also help you keep a track of all the vehicles which are moving in real-time along with data like direction, fuel, mileage, speed and location...
Several Popular Business Dashboard Examples - This facilities executive dashboard sample displays the percentage of work orders started and completed, and tracks the man hours necessary for completion of said work orders. A number of line charts display the fluctuations in these various measures over time, enabling managers to pinpoint where specific issues occurred...