Scripted Reports API (SR API)

SR - set of utility methods and libraries that are available in the Actonic Report Builder.

You can access API descriptions here sr-api (actonic.io) or by exploring the iFrame containing the same data below.

pdfOptions

By default SR uses pdfmake library for export. You can configure PDF layout with specifying PDFmake configuration object (for example, page format, page margins, landscape/portrait mode, watermark, etc).

SR.pdfOptions(pdfmakeConfigurationObject)

Example:

SR.pdfOptions({ pageOrientation: 'landscape', pageMargins: [20, 15, 20, 15], }); // expected result: page orientation of pdf to be landscape // and margins [left, top, right, bottom] to be applied.

Documentation for pdfmake: https://pdfmake.github.io/docs/0.1/

pdfDoc

Replace default export PDF result with specifying “jsPDF” object for export. If set, this method replaces pdfmake export that’s used by default.

SR.pdfDoc(jsPDFDoc)

Example:

Documentation for jsPDF: https://github.com/parallax/jsPDF