Report template

Layout and style for the Content Miner report.

You can define your template layout for the Content Miner report. On the left, you can edit the code for the template, and the change will quickly be reflected to the right Preview area.

HTML

You can edit a layout from the HTML tab. The default layout code is in the code area. The code format must be EJS.

The following variables are reserved words that you can use in the code. The values defined in the Report editor will be assigned these variables. For more about the Report editor, see the Create a Report section of the Report view.

  • reportTitle: The value input to Title field on the Report editor will be assigned to this variable.
  • reportSummary: The value input to Summary field on the Report editor will be assigned to this variable.
  • reportDate: The value input to Date field on the Report editor will be assigned to this variable.
  • images: When you upload your image from the Image tab, uploaded images will be assigned to this variable as an array. The first uploaded image can be referred to by images[0], and it will be used as a logo as default.
  • charts: Saved charts (analysis results or documents) will be assigned to this variable as an array. To render all saved charts, you should use a loop in the default code. Chart variable has the following properties.
    • title - The title of the chart.

    • description - The comment of the chart. So, charts[0].title means the title value of the first saved chart and charts[1].description means the comment of the second saved chart. To render the chart, you have to define an HTML element which has an ID of chart + index. Also, the index must be started from 1. For example, to render the first saved chart, you have to define the element like: <div id="chart1" />.

CSS

You can edit the style from the CSS tab.

You can upload images to use in the Report. As mentioned in the above HTML section, to use an uploaded image, you need to use the images array variable. Also, you can copy a Data URL text of the image from the menu icon of the thumbnail. If you want to use the image in CSS, you should use Data URL text like background-image: url(<COPIED_TEXT>).

If the uploaded image is deleted, the index of the images variable will be slipped. For example, in the case where two images are uploaded, you can refer to the first image as images[0], and the second as images[1]. If you delete the first image, the index of the second image will be slipped into index 0, so it can then be referred by using images[0] instead of images[1].