Skip to main content
Windward

WindwardReports.dll Utilities

engine-wiki-logo.pngOverview

WindwardReports.dll part of the install includes some useful utilities.

JoinReports

JoinReports.joinPdf() combines multiple reports into a single PDF document.

This operates differently from importing multiple templates into a master DOCX or XLSX template.

When you use the import tag, the imported template is converted into an element in the master template. For example, importing an XLSX file into a DOCX file converts the worksheets into Word tables. A Word table does not have the concept of hidden rows/columns, etc. and so that meta information is lost.

JoinReports keeps each document in its native template format. Each is then rendered to PDF and the PDF pages are then joined together in a single PDF document. This way you can combine DOCX and XLSX templates and both render their PDF pages as they would directly.

The API is passed an array of ProcessReport objects (and an OutputStream for the generated PDF report). If you are combining a number of static documents this is overkill and requires a couple of additional lines of code. However, if you want to build up distinct reports, applying data to templates, then combine those generated reports, this supports that use case.

RunReport

Process an XML and RTF file into a report. This is a sample program that runs a report from the command line. The most common usage is:

java net.windward.xmlreport.RunReport template.rtf report.htm –xml order.xml

The three filenames can be anything you want. They are:

  • template.rtf - the report template. It can also be template.docx, template.xml, template.xlsx, template.pptx, or template.html

  • report.htm, which is the report created. This file can have an extension of RTF, HTML, PDF, TXT, WordML, SpreadsheetML, or XLS and will create a report in the appropriate format. For details and limitations of the WordML, SpreadsheetML, and XLS formats, please refer to the Template Creator’s Guide.

  • order.xml - the XML data to use for the report.

     

Here’s an example of using RunReport from the command line.

RunReport template_file output_file [-xml xml_file | -sql connection_string | -oracle connection_string | -ole oledb_connection_string] [key=value | ...]

The template_file can be a rtf or xml (WordML) file.

The output file extension determines the report type created:

output.htm - HTML file with no CSS

output.html - HTML file with CSS

output.pdf - Acrobat PDF file

output.rtf - Rich Text Format file

output.sml - SpreadsheetML file (rename to .xml to use)

output.txt - ASCII text file

output.xhtml - XHTML file with CSS

output.xml - WordML file

The datasource is identified with a pair of parameters

set username=user password=pass for database connections

must come BEFORE each -sql, ... part

-xml filename - passes an xml file as the data source

-sql connection_string - ex: //localhost:1433;DatabaseName=Northwind

-oracle connection_string

-ole connection_string

You can have 0-N key=value pairs that are passed to the data source Map property

  • Was this article helpful?