Create a PDF document builder

Last modified by Aurelie Bertrand on 2025/07/04 17:22

🙋 This tutorial is intended for advanced users.

⏱ It is designed to be followed independently in 2 hours.



Introduction

In this tutorial, we're going to find out how to create a PDF document builder.

To do this, we are going to produce a PDF report on the turnover (CA) achieved for different product families of a company. It is based on the retailfr.xls dataset, which corresponds to fictitious data from a retail company containing information on products and data such as prices, sales, margins, etc.

The various stages of this tutorial are as follows:

  • Creation of the data model based on the retailfr.xls file
  • Creation of the 6 charts to be used in the report:
    • Summary table of turnover by product family
    • Breakdown of turnover by product
    • Lines showing sales growth by month
    • Breakdown of sales by region
    • Comparison of sales by product
    • Table listing product families for each section
  • Creation of the PDF builder
  • Creation of the dashboard page used to generate the PDF report

Prerequisites

In order to complete this tutorial, you need to :

  • have installed DigDash Enterprise version 2025R1 or higher ;
  • be a member of the"Data Model Designer" and"Dashboard Designer" authorisation groups;
  • download the resources archive tutoriel_fabrique_pdf_ressources.zip containing the retailfr.xls file and the images used.

ℹ The screenshots in this tutorial were created using the Chrome browser. There may be slight differences depending on the browser.

Step 1: Creating and configuring the data model

This entire part of the tutorial takes place in the Studio.

Import the retailfr.xls data source

Here we're going to import the data from the retailfr.xls Excel file we downloaded earlier. To do this

  1. Launch the Studio.
  2. Click on the Templates tab.
  3. Click on the New template button.
    Nouveau modèle Fichiers
  4. In the Create a new data model box, select All types in the Files section.
  5. In the Search for remote files box, select "Common Datasources" from the Server drop-down list and click the Add file to server... button.
    Search_remote_files_FR.png
  6. In the Select a file box, select From your computer, click the Browse... button and find the file retailfr.xls
  7. Click OK.
    ➡ The file is now saved on the DigDash Common Datasources server and accessible to all users.
  1. In the Remote File Search box, select the retailfr.xls file and then click OK.

The Excel File window appears. It offers data selection options and a preview of the data. Here we will configure the data model.

Configuring the data model

The elements in the first row of the table correspond to the heading of the data in each column. We are therefore going to use them as column headings. To do this, in the Data selection section, tick the First row as header box.

Filtering product families

Here we are going to concentrate on the product families:

  • Cold meats
  • Dessert
  • Sport & leisure
  • Telecom

We are therefore going to filter the rows for which the Family field is equal to the above values. To do this, in the Data selection section :

  1. Click on the Add... button.
  2. In the Edit filter rule box, select Family, then respond to the regular expression and enter Charcuterie|Dessert|Sport & leisure|Telecom.
    Rule_filter_family_FR.png
  3. Click OK.
    ➡ The other members of the Family dimension are greyed out.
  4. Click the Next button at the bottom right to open the data model configuration window.

Create the measures CA (Year - 1) and CA (% Progression)

We are now going to create 2 new measures calculated with the wizard: CA (Year - 1) and CA (% Growth). To do this

  1. In the Columns tab, click on the New measure button.
  2. Click on Calculated measure:
    • For the CA (Year-1) measure, drag and drop the Year-1 function from the Transformer tab onto the CA measure.
      Nouvelle mesure CA N-1
    • For the AC measurement (% Progression):
      • Drag and drop the % Progression function from the General tab onto the CA measurement.
      • Define the progression between the First measurement: CA (Year-1) and the Second measurement: CA.
      • Select the Format : Percentage and click OK.
        Progression CA
        ➡ The calculated measures are added to the list of columns.
  3. In the Properties tab, name the Retail data model and then click Finish at the bottom right to save it.

Now that the Retail data model is configured, we can create the charts based on this model.

Step 2: Creating the charts

ℹ This entire part of the tutorial takes place in the Studio.

We are now going to create the graphs that we will insert into our PDF builder.
All the graphs created in this tutorial will be based on the retail data model.

To create a chart (flow), click on the New Flow button and then select the desired flow.

Nouveau flux

Summary table of sales by product family

  1. Create a new Flow of the Cross table type.
  2. Select the data model and enter the name Summary of sales by product family.
  3. Drag the Family dimension onto the Column 1 axis.
  4. Place the measures Sales, Sales (Year-1) and Sales (% Growth) on the Line 1 axis.
    Synthèse du CA par famille
  5. Click on the sort button for the Column 1 axis and apply a descending sort to the Sales measure.
    Tri sur la mesure

We are now going to add an alert format to the Sales (% Growth) measure :

  1. Right-click on the Sales measure (% Growth) and then click on Apply a format -> Format manager... 
    Format CA progression
  2. In theFormat Editor, select Alerter and then click on the + button to create a new alerter format _tutoriel_progression.
     New_format_tuto_progression_FR.png

  3. Click on the + button in the Format Editor section on the right to create the following alerts with an Output Type of Colour + icon in the Percentage Format :
    • Value 0: equal sign
      Nouvel alerteur =
    • Interval -infinite to 0 : red down arrow
      Nouvel alerteur négatif
    • Interval 0 to +infinite: green up arrow
      Nouvel alerteur +

ℹ The order in which alerts are created must be respected.

  1. Click OK and select the _tutor_progression alert format for the measurement.Format _tutoriel_progression

    ➡ We obtain the following display in the table:
    Tableau avec alerteur

  2. Click OK at the bottom right of the editing window to save the Flow.

Breakdown of turnover by month

  1. Create a new Flow of the Cross table type.
  2. Select the data model and enter the name Breakdown of turnover by month.
  3. Drag the Date dimension onto the Column 1 axis (at Month level in the Date hierarchy).
    Hiérarchie date
  4. Place the Turnover, Turnover (Year - 1) and Turnover (% Growth) measures on the Line 1 axis.
  5. Apply the _tutoriel_progression alert format created earlier to the CA (% Progression) measure .

    Appliquer le format alerteur _tutoriel_progression

  6. Click on the sort button Bouton Tri on the Column 1 axis and apply the Data Model Sort to sort the months in chronological order.
    Tri modèle de données
  7. Click OK at the bottom right of the edit window to save the Flow.

Lines showing sales by month

  1. Create a new Lines flow.
  2. Select the data model and enter the name Lines by Month.
  3. Place the Date dimension on the Abscissa axis (at the Month level of the Date hierarchy).
  4. Place the Sales measure on the Lines axis.
  5. From the Specific parameters tab in the right-hand panel, add the Circle marker (contained in the Other category).
    Courbe d’évolution du CA par mois
  6. Click OK at the bottom right of the edit window to save the Flow.

Breakdown of turnover by region

  1. Create a new Flow of the Map type.
  2. Select the data model and enter the name Breakdown of sales by region.
  3. Drag the Sales measure onto the Measure Axis.
  4. Drag the Warehouse Region dimension onto the Geography axis: select the Continent level of the Geography hierarchy and tick the Add the "Navigate hierarchies" action box.
    Hirérarchie région magasin
  5. In the Interaction tab of the right-hand pane, tick the Navigate in hierarchy box if a filter is applied.
    Naviguer dans la hiérarchie si un filtre est appliqué
  6. Click on Colours in the toolbar to display the colour options.
  7. Click on the Edit button Editer to the right of the main palette to open the Colour Palette Manager.
  8. Click on the + button to create a new colour palette:
    • Enter the name _tutoriel_carte.
    • Define the 2 palette colours: colour codes #FFEBD7 and #B15900.
      Color_map_tuto_map_FR.png
    • Click OK.
      ➡ The new colour palette is applied to the map.
      Carte nouvelle palette
  9. Click OK at the bottom right of the editing window to save the Flow.

Comparing turnover by product

  1. Create a new Bar type Flow.
  2. Select the data model and enter the name Comparison of turnover by product.
  3. Drag the Product dimension onto the Bar axis.
  4. Place the Sales measure on the Stacking axis.
  5. Modify the colour distribution in the colour options: activate the colour distribution on the Bars axis.
    CA par produit
  6. Click on the sort button on the Bar axis and apply a descending sort on the CA measure.
    Tri décroissant CA
  7. Apply the Nb Abbrev format to the CA measure.
    Apply_nb_abbrev_revenue.png
  1. In the Labels tab of the right-hand panel:
    • activate Bar Content.
    • Tick the Automatic text colour box.
      Comparaison du CA par produit
  2. Click OK at the bottom right of the editing window to save the Flow.

Table listing the product families

We are going to create a table listing the product families that we are going to use to create a section. This section will be used to duplicate the sales details page for each product family contained in the table.

  1. Create a new Flow of type Table.
  2. Select the data model and enter the name Product Family List.
  3. Drag the Family dimension onto the Column 1 axis.
  4. Click on the sort button for the Column 1 axis and apply an ascending alphabetical sort.
    Liste des familles de produit
  1. Click OK at the bottom right of the edit window to save the Flow.

We have created all the graphs required for the report. Now we're going to create the PDF builder.

Step 3: Configuring the PDF builder

ℹ This entire part of the tutorial takes place in the Studio.

Here we're going to create and configure the PDF document builder. We're going to add the graphics we created earlier, as well as text boxes, images, page numbers, etc. to create a complete report.

  1. Create a new PDF document builder type Flow then, in the Properties tab :
  2. Name this Flow PDF Report.
  3. Define the output name of the PDF file in the Export name field: tutorial_report_CA_${filter.Date}_${filter.Region Warehouse}_${date.yyyyMMddhhmm}.

đź’ˇ The text ${date.yyyyMMddhhmm} put in the Export Name field corresponds to a DigDash keyword used to obtain the current date in the format YYYYMMDDhhmm.

  1. Click on the Editor button.
    Nouvelle fabrique PDF

➡ The PDF document builder editor opens. Here we will configure the PDF builder template.

Modifying the page parameters

First of all, we're going to modify the page layout:

  • In the Settings tab of the right-hand panel, change the document to A4 landscape format (297 x 210 mm).

Page paysage

Configure the cover page

On the first existing page, which will act as the cover page, we're going to add :

  • A header banner that will be repeated on every page (image)
  • A footer banner that will be repeated on every page (image)
  • Page numbering, repeated on every page (text)
  • A logo (image)
  • A title (text)

Add the header banner

To add the image corresponding to the header banner :

  1. Click on the Image button.
  2. Click on an empty zone on the right-hand side of the page to create an image zone.

    Ajout image

  3. Click on the 1716900965745-365.png button in the created zone and then click Edit to open the Icon Manager.
    Editer image
  4. In the Indicators tab, click Add a custom icon.
  5. Add the 2 images _custom_tutoriel_pdf_banniere_haut.png and _custom_tutoriel_pdf_banniere_bas.png (downloaded previously) then click OK in the Add a custom icon window.
    Add_custom_picture_FR.png
  1. In the Icon Manager window, select the image _custom_tutoriel_pdf_banniere_haut.png then click OK.

The first image is now present in the PDF template. To move and resize it, you can select it then drag and drop it or hold down one of the corners. To be more precise, you can also enter values directly in the fields in the toolbar above the page:

  • X (X coordinates from the left edge of the page)
  • Y (Y coordinates from the top edge of the page)
  • W (element width)
  • H (height of the element)

âť—These values vary depending on the screen resolution. For the same positioning, the values in your editor may differ from the values illustrated here.

  1. Resize it to the width of the page and position it at the top of the page.
  2. Click the 1716900965745-365.png button again, click on Type and then select Header : this will allow this element to be repeated on all the pages of the PDF report.
    Type En_tĂŞte

Add the footer banner

To add the footer banner, perform the same actions as above. For this element :

  1. Select the image _custom_tutoriel_pdf_banniere_bas.png.
  2. Resize it to the width of the page like the previous one and position it at the bottom of the page.
  3. Select the Footer type.

To add the logo :

  1. Click on the Image button.
  2. Click on an empty zone on the right-hand side of the page to create an image zone.
  3. Click on the 1716900965745-365.png button of the created area and then on Edit.
    ➡ The Icon Manager appears.
  4. In the Infographics tab, click Add a vector icon.
    Ajout infographie
  5. Add the image _custom_tutoriel_pdf_logo_digdash.svg (downloaded previously)
  6. Select the image _custom_tutoriel_pdf_logo_digdash.svg from the list and click OK.
    Logo DigDash
  7. Resize it and position it as shown below:
    Logo positionné

Add text

To add text :

  1. Click on the Text button.
  2. Click on an empty area of the page on the right to create a text zone.
  3. Click on the menu button for the zone you have created and then click on Edit.
  4. In the text zone, fill in the texts below, adding a line break between them:
    • CA indicators report
    • Report date: ${date.dd/MM/yyyy}
  5. Select the first line of text, set the font size to 72 and centre.
  6. Select the second line of text, set the font size to 16 and centre.
  7. Click OK.
    Ajout texte
  8. Resize and position the text box as shown below:Titre ajouté

Add page numbers

To add page numbering:

  1. Click the Page Number button and then select Page Number (Footer).
    ➡ Page numbering is added automatically at the bottom right of the page.
    Numéro de page

The cover page is now complete. We're going to add a new page to our PDF. To do this, click on the button in the toolbar above the page.

You can move between the different pages using the arrows at the bottom.
Ajout page 2

Configuring the summary page

In this second page, which will be the summary of the sales indicators, we are going to add :

  • A title (text)
  • 2 description texts (text)
  • Graphs:
    • Summary of sales by product family
    • Sales trend by month
    • Breakdown of sales by region

Add title

To add a title :

  1. Click on the Text button.
  2. Click on an empty zone on the right-hand side of the page to create a text zone.
  3. Click on the menu button for the zone you have created and then click on Edit.
  4. In the text editor, enter the title: Global summary.
  5. Set the font size to 28 and centre.
    Page2_title_FR.png
  6. Click OK.
  7. Resize the text box and position it as follows:
    Titre ajouté

Add the description texts

To add the description texts, follow the same steps as above:

  1. In the first text box, enter the following text: Below is a table summarising the turnover achieved by the different product families for the year _KEYWORD_YEAR_ compared with the previous year.

_KEYWORD_YEAR_ is a keyword that will be replaced by the value for the year selected when the PDF report is generated.

  1. In the second text box, enter the following text: The following pages detail sales by product family.
  2. Resize and position the text boxes to obtain a result similar to the illustration below:
    Zones de texte ajoutés

Add graphics

To add graphs :

  1. In the Flow by role tab on the left-hand panel, select the role containing your charts.
  2. Find the chart Summary of sales by product family.
  3. Drag and drop the Summary of sales by product family graph from the list of Flows onto the page.
  4. Do the same for the other 2 graphs: Change in turnover by month and Breakdown of turnover by region.
  5. Resize and position the graph areas to obtain the following model:
    Graphiques ajoutés

đź’ˇ You can multi-select the flows (Ctrl + left-click) to drag and drop several simultaneously.

  1. You can check the rendering of the various elements by activating Final Rendering in the toolbar above the page. If the area is not suited to the content, you can resize it.
    Rendu final

Now that the summary page is complete, we're going to add a new page to our PDF. To do this, click on the + button as before.

Configuring the details page

In this third page, which will detail the sales indicators by product family, we are going to add :

  • A title (text)
  • A description (text)
  • Graphs:
    • Sales details by month
    • Comparison of turnover by product
    • Breakdown of sales by region

This third page will use the notion of section, i.e. this page (and the elements it contains) will be repeated and filtered according to the values in a table (List of product families).

Adding the title

To add the title :

  1. Click on the Text button.
  2. Click on an empty zone on the right-hand side of the page to create a text zone.
  3. Click on the menu button for the zone you have created and then click on Edit.
  4. In the text box, enter the following text: Details for product family _KEYWORD_CATEGORY_

đź’ˇ _KEYWORD_CATEGORY_ is a keyword which will be replaced by the value of the product family concerned when the PDF report is generated.

  1. Select the text then set the font size to 28 and centre.
  2. Click on OK.
  3. Resize and position the text box as shown below:
    Titre ajouté

Add graphics

To add graphics :

  1. In the Flow by Role tab of the left panel, select the role containing your charts.
  2. Find the Turnover Breakdown by Month chart.
  3. Drag and drop the Breakdown of turnover by month graph from the left-hand panel onto the page.
  4. Do the same for the other 2 charts: Comparison of turnover by product and Breakdown of turnover by region.
  5. Resize and position the graph areas to obtain the following model:
    Graphiques ajoutés
  6. As on the previous page, activate Final rendering to check the rendering.

đź’ˇ If there are too many elements on your page, you can access each element from the Objects tab on the page and then access their properties by right-clicking on them.
Objets sur la page

Adding a section

We're going to define a section to display this third page for each product family. To do this

  1. Select the Sections tab in the right-hand panel.
  2. The index corresponds to the page number. Select index 3 then click on Add...
    ➡ The Section Source dialog box is displayed.
  3. Select the role used and then the Product family list table.
    Ajout section
  4. Click OK.
    ➡ The section is added. It is also displayed below the page.
    Section ajoutée

The template is now complete. Click OK at the bottom right of the window to save it and close the editor.

Configuring word substitution

The PDF report contains certain keywords which will need to be replaced by the data value when the report is generated. To do this, we set up a keyword substitution:

  1. In the Properties tab of the Flow Properties box, click on Configure.
    Configurer
  2. Click on the Word Substitution tab.
  3. Click on the Add... button.
  4. In the Key field, enter the keyword _KEYWORD_CATEGORY_.
  5. In the Value field, enter ${filter.Family} then click OK.
    Substitution de mots
  6. Repeat the operation to add a second substitution:
  7. In the Key field, enter the keyword _KEYWORD_YEAR_.
  8. In the Value field, enter ${filter.Date}.
  9. Click OK.

The PDF builder is now complete.
We will now create a dashboard with a button to run the PDF document builder.

Step 4: Create the dashboard and generate the PDF report

ℹ This part of the tutorial takes place in the Dashboard Editor and then in the Dashboard.

Creating the dashboard page

To create the PDF Report dashboard page :

  1. Launch the Dashboard Editor.
  2. Select the role you are using.
  3. Click the + button to create a new dashboard page and name it PDF Report.
    New page

Adding a PDF builder run button

We're now going to add a button that will allow us to generate the PDF report from the dashboard page.

  1. From the Additional content tab, drag and drop a button onto the newly created empty page.
  2. Select the button and in the Display section of the right-hand panel, enter PDF in the Text field.
  3. In the Actions section, click the Add button.
  4. In the Action dialog box, select the Run a PDF document builder type Flow action and then select the PDF Report flow.
    Ajout bouton PDF

Add a Date filter

Here we add a Date filter which will allow us to select the desired year for the report.

  1. As it is not possible to add a filter to a page that does not contain any graphs, add the Breakdown of turnover by region graph from the Flow information tab (Existing graphs) on the page.
    Ajout graphique
  2. From the Filters/Variables tab, add a filter on the Date dimension.
  3. In the filter properties panel, select Date and Year from the Hierarchy and Level drop-down lists.
  4. The report data will be filtered on a given year. In the Display section of the same panel:
    • Check the Hide "All" item box .
    • Check the box Prohibit empty selection.
    • Uncheck the Multiple selection box.
      Add_filter_date_FR.png

Generate the PDF report

All that remains is to access the Dashboard and generate the PDF report.

  1. Click on the Dashboard access button Accès Dashboard and save your changes.
    Save_DB_message_FR.png
  2. In the dashboard, select a year and then click on the PDF button to generate a PDF report.

For example, if we select 2019, we get the following report  tutoriel_rapport_CA_2019_Tous_202502031041.pdf .

If we filter geographically at country level for France for the year 2018, we obtain the following report  tutoriel_rapport_CA_2018_France_202502031047.pdf

Congratulations!

You've successfully created your first PDF document builder.
Now all you have to do is create your own report using your data!