Reports generation

Library to generate reports.

reports.generate(generator?: string, name: string, language: string, country: string, template?: string, data?: object)

Generate a report by using a template and by passing the report data as a parameter.

Arguments:
  • generator

  • name – Name of the generated report

  • language – Language of the report. Combined with country to define localization

  • country – Country of the report. Combined with language to define localization

  • template – Item ID of the template.ospp.

  • data – Context given to the report for the FTL template

Returns:

An object with attribute :

  • success (boolean) Indicates whether the operation was successful.

  • message (string) Contains additional information about the operation’s success or failure.

  • content (object) Data returned from a successful request.

content is an object that contains:

  • template (string) id of the template of this report.

  • report (string) If generated report is a pdf, this contains the pdf represented as a base64 string

  • parsed (string) represent the parsed template (after FTL execution) as a base64 string

  • name (string) name of the report

  • format (string) format of the report (pdf, csv, html, plain)