This repository contains the AutoReport source code.
AutoReport is a library to generate personalized PDF and XLS reports.
Table of contents
Installation
npm install auto-report --save
Import it to your code using:
const AutoReport = ;
Examples
AutoReport
use HTML with tags to generate the PDF. For the examples below
We will use the following HTML.
{{@report_name}} {{@table}}
Example 1) Render a value:
const template = '<html>...'; // Template defined above. const AutoReport = ;const AutoReportPDF = ; AutoReportPDF; AutoReportPDF; AutoReportPDF;
Example 2) Render a table:
const template = '<html>...'; // Template defined above. const AutoReport = ;const AutoReportPDF = ; const columns = name: 'Name' name: 'Age' name: 'Country'; const rows = 'Mário' 12 'BR' 'Martin' 23 'US' 'Jacque' 22 'FR'; AutoReportPDF; AutoReportPDF; AutoReportPDF;
or (the rows can be an array of objects):
const columns = name: 'Name' name: 'Age' name: 'Country'; const rows = name: 'Mário' user_age: 12 country: 'BR' name: 'Martin' user_age: 23 country: 'US' name: 'Jacque' user_age: 22 country: 'FR'; AutoReportPDF; AutoReportPDF; AutoReportPDF;
More examples
Other examples will be created soon in addition to the complete documentation.
Contributing
You may contribute in several ways like creating new features, fixing bugs, improving documentation and examples or translating any document here to your language.