Bulk Report Generation in XHTML Format via Java
Generate reports in XHTML file using data source & a template.
How to Generate XHTML Reports Using Java
In order to create XHTML file reports, we’ll use
API which is a feature-rich, powerful and easy to use assembly API for Java platform. You can download its latest version directly from
and install it within your Maven-based project by adding the following configurations to the pom.xml.
Repository
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
Dependency
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>version of aspose-words API</version>
<classifier>jdk17</classifier>
</dependency>
Steps to Generate XHTML Reports via Java
- Load template in an instance of Document class
- Create an object of ReportingEngine
- Build report using Call engine.buildReport method
- Save the result with Doucment.save method
System Requirements
Before integrating the code, make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
- Get latest version of Aspose.Words for Java directly from Maven.
Generate Word Reports in XHTML Format - C#
// Create Document object and initialize with XHTML template.
Document xhtml = new Document("template.xhtml");
// Create Sender object.
Sender sender = new Sender("LINQ Reporting Engine", "Hello World");
// Create ReportingEngine object.
ReportingEngine engine = new ReportingEngine();
// Build report.
engine.buildReport(xhtml, sender, "s");
// Save as XHTML document.
xhtml.save("word.xhtml");
Free App to Assemble XHTML
Check our live demos to create XHTML files with following benefits.
XHTML What is XHTML File Format
The XHTML is a text based file format with markup in the XML, using a reformulation of HTML 4.0. These files are well suited to be open or viewed in a web browser. XHTML was designed to be more structured, less scripting, generic; using all the existing facilities of XML and more device independent. XHTML provides a generally worthwhile set of elements and attributes, with extension options in combination with style sheets. The attributes are used from the metadata attributes collection. XHTML provides flexibility and accessibility by subordinating all HTML presentation elements to style sheets. Style sheets are more versatile than these presentational elements. Specifications for HTML 4.01, HTML5 and XHTML are being dynamically developed by the World Wide Web Consortium (W3C).
Read MoreOther Supported Report Generation Formats
Using Java, one can easily generate reports of multiple formats including.