Web Technologies

jsreport installation with Node.js

jsreport is the open source platform for designing and rendering reports.It allows you to create various reports in various formats like PDF, Excel, HTML.  It also includes advanced reporting features like user management, REST API.


The jsreport can be installed like other npm modules. You can run the npm command after the installation of Nodejs.

npm install -g jsreport-cli

The jsreport needs to be initialized and configured with the following commands.

jsreport init
jsreport configure

We need to configure the things like protocol, port, Authentication and permission for jsreport to access the local storage.

To start the jsreport server use the following command and point your browser to the specified port.The default port for the jsreport server is http://localhost:5488

 jsreport start 

How to define data ?

Before creating a pdf invoice layout, you should prepare some sample data that will be used later to preview. The sample data should be in the form of json object.

jsreport make the thing easy by providing a user interface for the developers. You can get sample report format at the user interface.

Defining report template

Template defines what the result report is going to be look like and is used together with the input data every time you render a new report. You can create a report template again from the entity tree panel on the top left.

For the invoice tutorial, the first thing you need to do is associate the sample data you previously defined with the newly created template.We can also define styling for the report like doing in the normal html page.


jsreport supports various reports and various output formats. To specify output format choose a jsreport recipe. Recipe doesn’t only define the output format, but also how it is produced. You can define an html template and then just by changing the recipe it will produce reports in the format of pdf, html or excel.

The easiest way to create a pdf invoice is to use html to pdf conversion provided by chrome-pdf recipe.You can find the recipes in the bottom left corner. jsreport uses javascript templating engines to define report layout. You can bind input data, use loops, conditions or javascript helpers.The template engines which are used in the jsreport are handlebars, jsrender, EJS,Pug.

Test the Report:

After defining the template, data and recipe you can test the jsreport by clicking the RUN . Now the template will provide the specified structure for the report along with the data. You can also download the data by clicking the download button.

For more reference please visit:

Learn jsreport 
jsreport playground