jasper-stream

Simple nodejs wrapper (yo!) for a Jasper report PDF exporter


Keywords
node, jasper, stream, pdf
License
Unlicense
Install
npm install jasper-stream@0.9.60

Documentation

JasperStream

JasperStream is a wrapper around the DynamicReports java library, which allows us to use streams for PDF creation, therefore enabling the creation of huge PDF files. As it doesn't need to load a html file in a headless browser, like it's done in several node packages, your small server can live a long and prosper life without struggling with memory comsumpion. 

BUT bear in mind that you'll need to create your own Dynamic Reports layout in order to use it. And build the .jar again. 

Yes, it's tightly coupled to our needs. Sorry about that.

Here are the parameters you need to pass on the the module as a json:

{
  "report_name": "", // the filename
  "report_title":"", // the report title
  "filters": { // a json with a mandatory "and" array and an optional "or" array
    "or":[],"and":[]},
    "fields":[], // An array of strings
    "columns":[], // An array of column labels
    "aggs": // groupBy and sum aggregations
      {
        "group":[], // array of groups
        "sum":[]// array of sums
      },
    "count": 9 // report total records
  }
}