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?
Optional options
Returns
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()
staticfromFileCoverTemplate(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?
Returns
Report
fromDocFile()
staticfromDocFile(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()
staticfromDocFileWithDocumentTemplate(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()
staticfromString(handlebarTemplate,data,compileOptions?):Report
Creates a new Report Instance by given template string and data
Parameters
handlebarTemplate
string
data
object
compileOptions?
Returns
Report
Static
Memberof
Report
fromDocumentTemplate()
staticfromDocumentTemplate(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()
staticfromFilePath(filePath,data):Report
Creates a new Report Instance by given file path and data.
Parameters
filePath
string
data
object
Returns
Report
Static
Memberof
Report