A node.js module, require JRE 1.6 or later, PRD 3.9 or later and is 100% GNU GPLv3 licensed.
npm install node-prdnpm install (not yet)
- Java Development Kit (JDK) 1.6 or later
- Pentaho Report Designer 3.9 or 4.0
- reportBundlePath (mandatory): is the location of PRD defintion bundle.
Example: reportBundlePath: '/home/magm/report.prpt'
- outputFilePath (mandatory): is the location of output file, with or without extension (see also: outputType)
Example: outputFilePath:'/home/magm/report.pdf'
- outputType (mandatory): is the output render type. The possible values are: pdf, excel, excelXlsx, rtf or html.
In case of html output, need to set the value for: htmlFolder
Example: outputType: 'pdf'
- htmlFolder (mandatory in case outputType=html): is the name that will be used to create a folder from the parent folder set in outputFilePath.
In this folder will place all the files that compose the HTML output. The home page will have the name specified in: outputFilePath
Is recommended that a folder can then serve from the web application
- params (optional): array of objects that represent report parameters.
Each object contains the following attributes:
- name: is the prd report attribute name. Attention: the name is case sensitive
- value: the value of parameter
- type: the data type of parameter. Possible values are: Integer, Long, Double, Float, Date and String for now.
Numeric values are not quoted and decimal separator must be a point, not an comma, Date value must be unix timestamp format
To implement an alternative data source, in the first place, must be added the attribute dataFactory.
dataFactory: is the attribute that defines an alternative data source.
If you want change data source, first must be select the correct.
The options are: NamedStatic, Sql, XPath, Kettle and BandedMDX.
To select the type of data source, we must insert the type attribute within DataFactory
type: the type of data source to implement. Possible values are: NamedStatic, Sql, XPath, Kettle and BandedMDX.
#### NamedStatic: data are sent from the node application in json format.
Example of configuration:
"dataFactory" : {
"type" : "NamedStatic",
"columnNames" : ["idZona","Zona"],
"columnTypes" : ["Integer","String"],
"data" : [
[1,"east"],
[2,"west"],
[3,"north"],
[4,"south"]
]
}
- columnNames: Array that contains the names of the columns. Please note that the names are defined exactly as defined in the report. The number of defined columns here, define the number of columns in the data.
- columnTypes: contains data type for each of columns defined in columnNames.
- data: a two-dimensional array containing data.
Copyleft 2012 Mariano García Mattío
node-prd is 100% licensed GNU GPLv3