1.0.2 • Published 26 days ago
bl2-js-report v1.0.2
bl2-js-report
npm i bl2-js-report
💞️ Basic Usage
Add line in component file
import * as bl2Js from 'bl2-js-report';
In html page
<button (click)="downloadPdf()" type="button">Download PDF</button>
In js or ts file
downloadPdf() {
this.data['fileName'] = 'save-file-name';
this.data['templateName'] = 'ti-reports/Researcher-Profile-Information'; //file path
this.data['data'] = JSON.stringify(this.data);
this.data['userDetails'] = JSON.stringify(this.userData);
this.data['isInstitutional'] = JSON.stringify(this.isInstitutional);
this.data['name'] = JSON.stringify(this.name);
//Optional
this.data['view'] = 0; // 0 = false or 1 = true
this.data['print_r'] = 0; // 0 = false or 1 = true
let actionUrl = `${reportBackend}/pdf-generate-post`;
bl2Js(this.data, actionUrl);
}