For the complete documentation index, see llms.txt. This page is also available as Markdown.

PDF reports (Xreport)

Produce PDF reports from selected worksheets.

Syntax: Xreport_<parameter>

  1. Define the Print_Area for the target sheets.

    • Ensure that each Xreport worksheet has a worksheet scope variable called Print_Area.

    • Add an extra row and extra column of padding around any cells with large text.

    • Please do not include any Xinputs in the worksheet - these will not be rendered correctly.

    • Spark does not support Print_Area ranges that are dynamically defined using formulas.

  2. Rename the worksheet(s) with a name in the format Xreport_<parameter>, for example, Xreport_illustration.

  3. Upload the file to Spark and open the API Tester.

  4. API request (inputs) Field view lists all the Xreports that have been defined in the workbook.

  5. Next to the Report Name field, is the File Name field, which corresponds to the FileName parameter of the API request. Enter the desired filename here, for example, customfilename.pdf. If no filename is provided, then a UUID is used for the filename.

  6. Click Submit to make the API request.

  7. In the API response (outputs) Field view, open the Reports expandable.

  8. Each report will be listed in the table with a link to download the PDF report.

Sample file

Open

Control report rendering

Use request_meta xreport_options to modify how the report is rendered.

No xreport_options are used in the request

{ "produce_pdfs": true, "multiple_docs": true, "page_numbers": true, "render_chart_texture_bars_as_images": false }

produce_pdfs

Boolean to indicate whether to return the Xreport sheets as PDFs. Default is true.

Set this to false for a faster API response or if the PDF report is not required.

multiple_docs

Boolean to indicate whether to return each Xreport sheet as a separate PDF.

  • If no xreport_options are used in the request, the default is true .

  • If xreport_options are used in the request, the default is false .

page_numbers

Boolean to indicate whether to include page numbers. Default is true.

render_chart_texture_bars_as_images

Boolean to resolve an issue with borders appearing for dynamic chart images. Default is false.

Formatting features

Supported fonts

Xreport supports the following fonts:

  • AR PL UMing (Chinese)

  • Angsana (Thai)

  • Arial (default)

  • Garuda (Thai)

  • Halant (Devanagari script)

  • HK Grotesque

  • Montserrat

  • Noto Sans CJK Regular (Chinese/Japanese/Korean)

  • Open Sans

If Spark detects any font other than the ones listed above, it will use the Arial font.

Exclude certain rows

Excel output content can vary in length. You may want to exclude extra empty pages at the end of the output.

Whether a row is included in an Xreport can be controlled by inserting a column within the Print_Area with the heading Hide in Report Output. Within this column a value of FALSE will exclude that row from being included in the report. The Print_Area must be a single contiguous area for this feature to work. Note the dotted line page breaks in the sample file.

Render charts

Xreport is able to render charts into the PDF reports. To make the data series for a chart visible, the data series must reference data that is within the Xreport worksheet's defined Print_Area. Not all chart types are supported by Spark.

Change images based upon an input

Formulas that resolve the image must be within the Xreport worksheet's defined Print_Area.

Troubleshoot inconsistent margins

Saving Excel workbooks while using different Windows display scaling settings (100%, 125%, 150%, etc.) can lead to slightly different margin widths. When uploaded to Spark, this may lead to Xreport not rendering as intended by the author.

If you are seeing margins shift between different iterations of a Spark service, check that all contributors are using consistent display scaling.

Last updated