Zum Hauptinhalt springen

Report

Constructors​

Constructor​

new Report(htmlOrOptions): Report

Creates an instance of Report.

Parameters​

htmlOrOptions​

ether provide a html-string or report options

string | ReportOptions

Returns​

Report

Memberof​

Report

Examples​

const report = new Report("some html");
const report = new Report({ html: "some html" });

Properties​

options​

options: ReportOptions

Methods​

save()​

save(filePath?): string

Saves the current html-string on filesystem.

Parameters​

filePath?​

string

a given filePath otherwise a temp file path will be generated.

Returns​

string

the file path to the html file.

Memberof​

Report


saveAsPdf()​

saveAsPdf(filePath?, options?): PdfSaveResult

Converts the html-string into a pdf file.

Parameters​

filePath?​

string

a given file path where to store the pdf file otherwise a temp file path will be generated.

options?​

ReportPdfStoreOptions

Optional options

Returns​

PdfSaveResult

A save result object containing the pdf file path and actions

Memberof​

Report


toGadget()​

toGadget(id?): string

Returns the Report as HTML-Gadget

Parameters​

id?​

string

Returns​

string

Memberof​

Report

Example​

// Gadget_ou.cust.demo.filetype.html.report
const report = new Report("Hello world");
context.returnValue = report.toGadget();

toString()​

toString(): string

Returns the html as string

Returns​

string

Memberof​

Report


fromFileCoverTemplate()​

static fromFileCoverTemplate(docFile, fileCoverOptions?): Report

Creates a new Report instance by using the template fileCover If you want to use the file cover report as gadget, set fileCoverOptions.asPdf = false

Parameters​

docFile​

DocFile

fileCoverOptions?​

FileCoverTemplateOptions

Returns​

Report


fromDocFile()​

static fromDocFile(docFile, templateOrFilePath, additionalData?): Report

Creates a new Report Instance by a given docFile and template string

Parameters​

docFile​

DocFile

templateOrFilePath​

string

additionalData?​

object

Returns​

Report

Static​

Memberof​

Report


fromDocFileWithDocumentTemplate()​

static fromDocFileWithDocumentTemplate(docFile, templateName, additionalData?): Report

Creates a new Report Instance by given docFile and document template. Uses context.getDocumentTemplateFromFileType

Parameters​

docFile​

DocFile

templateName​

string

additionalData?​

object

Returns​

Report

Static​

Memberof​

Report


fromString()​

static fromString(handlebarTemplate, data, compileOptions?): Report

Creates a new Report Instance by given template string and data

Parameters​

handlebarTemplate​

string

data​

object

compileOptions?​

CompileOptions

Returns​

Report

Static​

Memberof​

Report


fromDocumentTemplate()​

static fromDocumentTemplate(fileTypeName, templateName, data): Report

Creates a new Report Instance by given fileTypeName, template name and data. Uses context.getDocumentTemplateFromFileType

Parameters​

fileTypeName​

string

templateName​

string

data​

object

Returns​

Report

Static​

Memberof​

Report


fromFilePath()​

static fromFilePath(filePath, data): Report

Creates a new Report Instance by given file path and data.

Parameters​

filePath​

string

data​

object

Returns​

Report

Static​

Memberof​

Report