Configuring registry regulations excerpts: PDF, DOCX and CSV

1. General description

You can create and upload excerpts (reports) in .pdf, .docx, .csv formats, as well as fill in the files with the corresponding business data of the registry only after configuring the registry regulations.

The registry administrator should add the pre-generated report template and its attributes to the respective directory of the registry regulations, for example:

  • for .pdf — excerpts/my-report-excerpt-pdf/index.html.ftl;

  • for .docx — excerpts-docx/my-report-excerpt-docx.docx;

  • for .csv — excerpts-csv/my-report-excerpt-csv.csv.

Diagram

where:

  • excerpts, excerpts-docx, excerpts-csv — mandatory directory names for excerpts (reports) in the respective format;

  • index.html.ftl, my-report-excerpt-docx.docx, my-report-excerpt-csv.csv — examples of report names in the respective format.

The name of each directory and the file must be unique. The requirement also applies to different formats.

Based on these templates, the report files will be generated in the respective format in the registry user portals.

2. Configuring registry regulations export settings

2.1. Generating reports in PDF format

To add a template for generating excerpts (reports) in .pdf format, perform the following actions in the regulations of the corresponding registry:

You can find the detailed information on working with registry regulations on the following page: Deploying registry regulations in Gerrit.
  1. Access the local Gerrit repository of the registry.

  2. Place the report template file in the directory with the template resources. This directory should have a unique name for the specified template, such as excerpts/my-report-excerpt-pdf/index.html.ftl.

    The excerpt (report) template should be created in a special .html.ftl format. You have to create such a template in HTML markup using the Apache FreeMarker template engine, which is used to interpret the syntax that configures variable substitution in PDF templates (.html.ftl) or for .docx format.

    Find the detailed information about Apache FreeMarker at the following link: https://freemarker.apache.org/

    The template file name should always be specified as index.html.ftl, and the directory should be named after the report, for example, my-report-excerpt-pdf.

  3. Save the styles that will be applied to the report template. To do this, create a style.css file and place it in the excerpts/my-report-excerpt-pdf/css directory.

    Example: <link rel="stylesheet" href="style1.css">.

    It is also possible to use multiple .css styling files. To do this, you need to specify the link to each file, for example:

    <html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="style1.css">
        <link rel="stylesheet" href="style2.css">
        <link rel="stylesheet" href="style3.css">
        <style>
        .....
        * { font-family: Roboto; }
        </style>
    </head>
    <body>
    • UTF-8 encoding is mandatory.

    • By default, the font * { font-family: Roboto; } is used. It is automatically added to the styles. The use of other fonts is not allowed, as it may lead to conflicting errors in operation.

    You can set the horizontal orientation of the page report by configuring the style.css file, for example:

    @page {
    size: 15in 8.5in;
    margin-bottom: 0.75in;
    margin-left: 0.9in;
    margin-right: 0.9in;
    margin-top: 0.75in;
    }

    The "size" parameter specifies the width (in this example, 15in) and height (in this example, 8.5in) of the file in inches (inches). Margin parameters can also be adjusted.

  4. Save the image in .png format, which will be used for the report file. Place the image in the excerpts/my-report-excerpt-pdf/images directory.

    Example: <img src="images/image.png">.

  5. Save the changes to the remote Gerrit repository.

  6. After deploying the register’s regulations and configuring the business process, users will be able to initiate a business process to generate and download the report in .pdf format (for more information, see Generating excerpts in PDF format).

2.2. Generating reports in DOCX format

To add a template for generating excerpts (reports) in .docx format, the following settings need to be applied to the regulations of the respective register:

You can find the detailed information on working with registry regulations on the following page: Deploying registry regulations in Gerrit.
  1. Access the local Gerrit repository of the register.

  2. Place the report template file in the directory with the template resources. This directory should have a unique name for the specified template, such as excerpts-docx/my-report-excerpt-docx.docx.

  3. Save the changes to the remote Gerrit repository.

  4. After deploying the registry regulations and configuring the business process, users will be able to initiate a business process to generate and download the report in .docx format (for more information, see Generating excerpts in DOCX format)

At the following link you can learn more about formatting the content of the excerpt (report) in .docx format.

For an example of modeling a business process for generating excerpts (reports) in .csv and .docx formats, see Modeling business processes for generating excerpts in csv and docx format.

2.3. Generating reports in CSV format

To add a template for generating excerpts (reports) in .csv format, perform the following actions in the regulations of the corresponding registry:

You can find the detailed information on working with registry regulations on the following page: Deploying registry regulations in Gerrit
  1. . Access the local Gerrit repository of the register.

  2. Place the report template file in the directory with the template resources. This directory should have a unique name for the specified template, such as excerpts-csv/my-report-excerpt-csv.csv.

    To change the column header names, create a .json or .csv file with the replacement settings in the excerpts-csv directory of the corresponding excerpt (report), for example:

    {
      "lastName": "Прізвище",
      "firstName": "Ім'я",
      "secondName": "По батькові",
      "birthday": "Дата народження",
      "residenceAddress": "Адреса",
      "phoneNumber": "Телефон",
      "gender": "Стать",
    }

    The first column specifies the names of the parameters to be used in the excerpt (report), and the second column specifies the names to replace the column headers with.

  3. Save the changes to the remote Gerrit repository.

  4. After deploying the register’s regulations and configuring the business process, users will have the ability to initiate a business process to generate and download the excerpt (report) in .csv format (for more information, see Generating excerpts in CSV format).

For an example of modeling a business process for generating excerpts (reports) in .csv and .docx formats, see Modeling business processes for generating excerpts in csv and docx format.