Server-side Report builder
// Server side report generation
const fs = require('fs');
const UBReport = require('@unitybase/ubs/modules/UBServerReport');
let reportResult = UBReport.makeReport('test','pdf',{});
if (reportResult.reportType === 'pdf') {
console.debug('Generate a PDF report of size=', result.reportData.byteLength)
fs.writeFileSync('d:/result.pdf', result.reportData )
} else {
console.debug('Generate a HTML report of size=', result.reportData.length)
fs.writeFileSync('d:/result.html', result.reportData )
}
Classes
Methods
# makeReport (reportCode: string | Object, reportTypeopt: string, params: *) → ReportResult static
Render report with code reportCode
on the server side
Report templates and creation rules are defined in ubs_report
entity.
Types
# ReportResult inner
Report generation result
Properties