Wiki source code of Créer une fabrique de documents PDF
Last modified by Aurelie Bertrand on 2025/10/27 15:19
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | (% class="box infomessage" %) | ||
| 2 | ((( | ||
| 3 | 🙋 This tutorial is intended for **advanced users**. | ||
| 4 | |||
| 5 | ⏱ It is designed to be followed independently **in 2 hours.** | ||
| 6 | ))) | ||
| 7 | |||
| 8 | ---- | ||
| 9 | |||
| 10 | (% contenteditable="false" tabindex="-1" %) | ||
| 11 | ((( | ||
| 12 | {{ddtoc/}} | ||
| 13 | ))) | ||
| 14 | |||
| 15 | ---- | ||
| 16 | |||
| 17 | = Introduction = | ||
| 18 | |||
| 19 | In this tutorial, we're going to find out how to create a PDF {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}}. | ||
| 20 | |||
| 21 | To do this, we are going to produce a PDF report on the sales achieved for different product families of a company. It is based on the retailen_2025.xls dataset, which corresponds to fictitious data from a retail company containing information on products and data such as prices, sales, margins, etc. | ||
| 22 | |||
| 23 | The steps of this tutorial are as follows: | ||
| 24 | |||
| 25 | * Creation of the data model based on the Excel file | ||
| 26 | * Creation of the 6 charts to be used in the report: | ||
| 27 | ** Summary table of sales by product family | ||
| 28 | ** Table of sales by product | ||
| 29 | ** Monthly sales trend | ||
| 30 | ** Sales by region | ||
| 31 | ** Comparison of sales by product | ||
| 32 | ** Table listing product families for each section | ||
| 33 | * Creation of the {{glossaryReference glossaryId="Glossary" entryId="Fabrique PDF"}}PDF builder{{/glossaryReference}} | ||
| 34 | * Creation of the dashboard page used to generate the PDF report | ||
| 35 | |||
| 36 | = Prerequisites = | ||
| 37 | |||
| 38 | In order to complete this tutorial, you need to : | ||
| 39 | |||
| 40 | * have installed DigDash Enterprise version 2025R2 or higher ; | ||
| 41 | * be a member of the **"Data Model Designer**" and **"Dashboard Designer**" authorization groups; | ||
| 42 | * download the resources archive [[tutoriel_fabrique_pdf_ressources.zip>>attach:pdf_builder_tutorial_ressources.zip]] containing the retailen_2025.xls file and the images used. | ||
| 43 | |||
| 44 | (% class="box" %) | ||
| 45 | ((( | ||
| 46 | ℹ The screenshots in this tutorial were created using the Chrome browser. There may be slight differences depending on the browser. | ||
| 47 | ))) | ||
| 48 | |||
| 49 | = Step 1: Create and configure the data model = | ||
| 50 | |||
| 51 | (% class="box infomessage" %) | ||
| 52 | ((( | ||
| 53 | This part of the tutorial entirely takes place in the Studio. | ||
| 54 | ))) | ||
| 55 | |||
| 56 | == Import the data source == | ||
| 57 | |||
| 58 | Here we're going to import the data from the retailen_2025 Excel file we downloaded earlier. To do this: | ||
| 59 | |||
| 60 | 1. Launch the Studio. | ||
| 61 | 1. Click the **Models** tab. | ||
| 62 | 1. Click the **New model** button. | ||
| 63 | (% contenteditable="false" tabindex="-1" %)[[image:New_model_EN.png||alt="New model" height="461" width="845"]](% title="Click and drag to resize" %) | ||
| 64 | 1. In the **Create a new data model** box, select **Any types **in the **Files** section. | ||
| 65 | 1. In the **Search for remote files** box, select "**Common Datasources**" from the **Server** drop-down list and click the **Add file...** button. | ||
| 66 | (% contenteditable="false" tabindex="-1" %)[[image:Search_remote_files_dialog_EN.png||alt="Search for remote files" height="353" width="653"]](% title="Click and drag to resize" %) | ||
| 67 | 1. In the **Select file **box, select **From your computer**, click the **Browse... **button and find the file //retailen_2025.xls// | ||
| 68 | 1. Click **OK**. | ||
| 69 | ➡ The file is now saved on the DigDash Common Datasources server and accessible to all users. | ||
| 70 | |||
| 71 | (% start="8" %) | ||
| 72 | 1. In the **Remote File Search** box, select the //retailen_2025.xls //file and then click **OK**. | ||
| 73 | |||
| 74 | The **Excel File **window appears. It offers data selection options and a preview of the data. Here we will configure the data model. | ||
| 75 | |||
| 76 | == Configure the data model == | ||
| 77 | |||
| 78 | 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, select the **First row as header** checkbox. | ||
| 79 | |||
| 80 | === Filter product families === | ||
| 81 | |||
| 82 | Here we are going to concentrate on the following product families: | ||
| 83 | |||
| 84 | * Deli | ||
| 85 | * Dessert | ||
| 86 | * Sport & leisure | ||
| 87 | * Telecom | ||
| 88 | |||
| 89 | We are therefore going to filter the rows for which the **Product Family **field is equal to the above values. To do this, in the **Data selection** section : | ||
| 90 | |||
| 91 | 1. Click the **Add...** button. | ||
| 92 | 1. In the **Edit filter rule** box, select** Family**, then **respond to the regular expression **and enter **Deli|Dessert|Sport & leisure|Telecom**. | ||
| 93 | (% contenteditable="false" tabindex="-1" %)[[image:Add_filter_rule_EN.png||alt="Add rule"]](% title="Click and drag to resize" %) | ||
| 94 | 1. (% style="color:#36525b; font-size:14.6667px; white-space-collapse:preserve" %)Click(%%)** OK**. | ||
| 95 | ➡ The other members of the **Product** **Family **dimension are greyed out. | ||
| 96 | 1. Click the **Next** button at the bottom right to open the data model configuration window. | ||
| 97 | |||
| 98 | === Create the measures Sales (Year - 1) and Sales ~(% Progression) === | ||
| 99 | |||
| 100 | We are now going to create 2 new measures calculated with the wizard: Sales (Year - 1) and Sales ~(% Prgression). To do this | ||
| 101 | |||
| 102 | 1. In the **Columns** tab, click the **New measure** button. | ||
| 103 | 1. Click **Calculated measure**: | ||
| 104 | 1*. To add the **Sales (Year-1)** measure, drag and drop the **Year-1** function from the **Transformer **tab onto the** Sales** measure. | ||
| 105 | (% contenteditable="false" tabindex="-1" %)[[image:New_measure_sales-1_EN.png||alt="Year-1"]](% title="Click and drag to resize" %) | ||
| 106 | 1*. For the **Sales** **~(% Progression) **measure**:** | ||
| 107 | 1**. Drag and drop the **% Progression** function from the **General **tab onto the** Sales** measure. | ||
| 108 | 1**. Define the progression between the **First measure**: //Sales (Year-1) //and the **Second measure**: //Sales.// | ||
| 109 | 1**. Select the **Format **: //Percent //and click **OK**. | ||
| 110 | (% contenteditable="false" tabindex="-1" %)[[image:Sales_progression_EN.png||alt="Sales progression"]](% title="Click and drag to resize" %)(%%) | ||
| 111 | ➡ The calculated measures are added to the list of columns. | ||
| 112 | 1. In the** Properties** tab, enter **retail** as name for the data model and then click **Finish **at the bottom right to save it. | ||
| 113 | |||
| 114 | Now that the retail data model is configured, we can create the charts based on this model. | ||
| 115 | |||
| 116 | = Step 2: Creat the charts = | ||
| 117 | |||
| 118 | (% class="box infomessage" style="line-height: 1.2; text-align: justify;" %) | ||
| 119 | ((( | ||
| 120 | ℹ This entire part of the tutorial takes place in the Studio. | ||
| 121 | ))) | ||
| 122 | |||
| 123 | We are now going to create the charts that we will insert into our {{glossaryReference glossaryId="Glossary" entryId="Fabrique PDF"}}PDF builder{{/glossaryReference}}. | ||
| 124 | All the charts created in this tutorial will be based on the retail data model. | ||
| 125 | |||
| 126 | To create a chart (flow), click the **New {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}** button and then select the desired type of flow. | ||
| 127 | |||
| 128 | (% style="line-height: 1.2; text-align: justify;" %) | ||
| 129 | == Summary table of sales by product family == | ||
| 130 | |||
| 131 | 1. Create a new **{{glossaryReference glossaryId="Glossary" entryId="Tableau croisé"}}Cross table{{/glossaryReference}}**. | ||
| 132 | 1. Select the data model and enter the name **Summary of sales by product family**. | ||
| 133 | 1. Drag the** Product Family **dimension onto the **Column 1** axis. | ||
| 134 | 1. Place the measures **Sales**, **Sales (Year-1)** and **Sales ~(% Growth)** on the **Line 1** axis. | ||
| 135 | (% contenteditable="false" tabindex="-1" %)[[image:Summary_sales_crosstable_EN.png||alt="Summary of sales"]](% title="Click and drag to resize" %) | ||
| 136 | 1. Click the sort button for the **Column 1** axis and apply a descending sort on the **Sales **measure. | ||
| 137 | (% contenteditable="false" tabindex="-1" %)[[image:Family_sort_EN.png||alt="Product family sort"]](% title="Click and drag to resize" %) | ||
| 138 | |||
| 139 | We are now going to add an alert format to the **Sales ~(% Progression) **measure **:** | ||
| 140 | |||
| 141 | 1. Right-click the **Sales **measure **~(% Growth) **and then click **Apply a format -> Format manager... ** | ||
| 142 | (% contenteditable="false" tabindex="-1" %)[[image:Sales%_format_EN.png||alt="New format"]](% title="Click and drag to resize" %) | ||
| 143 | 1. In the **Format Editor**, select **Alerter** and then click the **+** button to create a new alerter format **_tutorial_progression. | ||
| 144 | (% contenteditable="false" tabindex="-1" %)[[image:New_format_progression_EN.png||alt="Progression format"]](% title="Click and drag to resize" %)(%%)** | ||
| 145 | 1. Click the **+** button in the **Format Editor** section on the right to create the following alerts with the **Output Type **//Colour + icon// and the **Format** //Percent~:// | ||
| 146 | 1*. Value **0**: equal sign | ||
| 147 | (% contenteditable="false" tabindex="-1" %)[[image:Aleter0_FR.png]](% title="Click and drag to resize" %) | ||
| 148 | 1*. Interval **-infinite to 0 **: red down arrow | ||
| 149 | (% contenteditable="false" tabindex="-1" %)[[image:Alerter_down_EN.png]](% title="Click and drag to resize" %) | ||
| 150 | 1*. Interval **0 to +infinite**: green up arrow | ||
| 151 | (% contenteditable="false" tabindex="-1" %)[[image:Alerter_up_EN.png]](% title="Click and drag to resize" %) | ||
| 152 | |||
| 153 | (% class="box warningmessage" %) | ||
| 154 | ((( | ||
| 155 | ℹ The order in which alerts are created must be respected. | ||
| 156 | ))) | ||
| 157 | |||
| 158 | (% start="4" %) | ||
| 159 | 1. Click **OK** and select the** _tutorial_progression** alert format for the measurement. | ||
| 160 | (% contenteditable="false" tabindex="-1" %)[[image:Alerter_progression_chosen_EN.png||alt="Alerter selected"]](% title="Click and drag to resize" %)(%%)((( | ||
| 161 | ➡ We obtain the following display in the table: | ||
| 162 | (% contenteditable="false" tabindex="-1" %)[[image:Crosstable_alerter_EN.png||alt="Crosstable with alerter"]](% title="Click and drag to resize" %) | ||
| 163 | ))) | ||
| 164 | 1. Click **OK **at the bottom right of the window to save the {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}. | ||
| 165 | |||
| 166 | == Table of sales by month == | ||
| 167 | |||
| 168 | (% start="1" %) | ||
| 169 | 1. Create a new **{{glossaryReference glossaryId="Glossary" entryId="Tableau croisé"}}Cross table{{/glossaryReference}}**. | ||
| 170 | 1. Select the data model and enter the name Table of sales by month. | ||
| 171 | 1. Drag the **Date** dimension onto the **Column 1 **axis (at Month level in the Date hierarchy). | ||
| 172 | (% contenteditable="false" tabindex="-1" %)[[image:Date_hierarchy_EN.png||alt="DAte hierarchy"]](% title="Click and drag to resize" %) | ||
| 173 | 1. Place the **Sales**, **Sales (Year - 1)** and **Sales ~(% Progression)** measures on the **Line 1** axis. | ||
| 174 | 1. Apply the **_tutorial_progression** alert format created earlier to the **Sales ~(% Progression)** measure**.** | ||
| 175 | 1. Click the sort button (% aria-label="Bouton Tri image widget" contenteditable="false" role="region" tabindex="-1" %)[[image:Sort_button_FR.png||alt="Bouton Tri"]](% title="Click and drag to resize" %)(%%) on the **Column 1** axis and apply the **Data Model Sort **to sort the months in chronological order. | ||
| 176 | (% contenteditable="false" tabindex="-1" %)[[image:DAte_sorting_EN.png||alt="DAta model sort"]](% title="Click and drag to resize" %) | ||
| 177 | 1. Click **OK **at the bottom right of the window to save the {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}{{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}. | ||
| 178 | |||
| 179 | == Monthly sales trend == | ||
| 180 | |||
| 181 | (% start="1" %) | ||
| 182 | 1. Create a new **{{glossaryReference glossaryId="Glossary" entryId="Courbes"}}Lines{{/glossaryReference}}** flow. | ||
| 183 | 1. Select the data model and enter the name Monthly sales trend. | ||
| 184 | 1. Place the **Date** dimension on the **Abscissa** axis (at the Month level of the Date hierarchy). | ||
| 185 | 1. Place the **Sales** measure on the **{{glossaryReference glossaryId="Glossary" entryId="Courbes"}}Lines{{/glossaryReference}}** axis. | ||
| 186 | 1. From the **Specific parameters** tab in the right-hand panel, add the **Circle** marker (contained in the **Other** category). | ||
| 187 | (% contenteditable="false" tabindex="-1" %)[[image:Lines_marker_EN.png||alt="Lines marker"]](% title="Click and drag to resize" %) | ||
| 188 | 1. Click **OK **at the bottom right of the edit window to save the {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}. | ||
| 189 | |||
| 190 | == Map of sales by region == | ||
| 191 | |||
| 192 | 1. Create a new Map chart. | ||
| 193 | 1. Select the data model and enter the name **Sales by region**. | ||
| 194 | 1. Drag the **Sales** measure onto the **Measure Axis**. | ||
| 195 | 1. Drag the **Store area** dimension onto the **Geography** axis: select the **Continent** level of the **Geography** hierarchy and tick the **Add the "Navigate hierarchies" action** box. | ||
| 196 | 1. In the **Interaction **tab of the right-hand pane, tick the **Navigate in hierarchy box if filter applied**. | ||
| 197 | (% contenteditable="false" tabindex="-1" %)[[image:Map_interaction_EN.png]](% title="Click and drag to resize" %) | ||
| 198 | 1. Click **Colors **in the toolbar** **to** **display the color options. | ||
| 199 | 1. Click the **Edit **button (% contenteditable="false" tabindex="-1" %)**[[image:Edit_button.png||alt="Editer" height="28" width="27"]]**(% title="Click and drag to resize" %)****(%%)** **to the right of the main palette to open the **Color Palette Setup**. | ||
| 200 | 1. Click the **+** button to create a new colour palette: | ||
| 201 | 1*. Enter the name **_tutorial_map**. | ||
| 202 | 1*. Define the 2 palette colors: color codes #FFEBD7 and #B15900. | ||
| 203 | (% contenteditable="false" tabindex="-1" %)[[image:Map_color_palette_EN.png||alt="Map color palette"]](% title="Click and drag to resize" %) | ||
| 204 | 1*. Click** OK**. | ||
| 205 | ➡ The new color palette is applied to the map. | ||
| 206 | (% contenteditable="false" tabindex="-1" %)[[image:1761316740538-961.png||data-xwiki-image-style-border="true"]](% title="Click and drag to resize" %) | ||
| 207 | 1. Click **OK **at the bottom right of the edit window to save the {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}. | ||
| 208 | |||
| 209 | == Comparison of sales by product == | ||
| 210 | |||
| 211 | (% start="1" %) | ||
| 212 | 1. Create a new **Bar** chart. | ||
| 213 | 1. Select the data model and enter the name **Comparison of sales by product**. | ||
| 214 | 1. Drag the **Product **dimension onto the **Bar** axis. | ||
| 215 | 1. Drag the **Sales** measure on the **Stacking** axis. | ||
| 216 | 1. Modify the color distribution in the color options: activate the color distribution in the coloModify the colo distribution on the **Bars** axis. | ||
| 217 | (% contenteditable="false" tabindex="-1" %)[[image:Colors_bar_chart_EN.png]](% title="Click and drag to resize" %) | ||
| 218 | 1. Click the sort button on the **Bar** axis and apply a descending sort on the **Sales** measure. | ||
| 219 | (% contenteditable="false" tabindex="-1" %)[[image:Bar_sorting_EN.png||data-xwiki-image-style-border="true"]](% title="Click and drag to resize" %) | ||
| 220 | 1. Apply the **Nbr. Abbrev. **format to the **Sales** measure. | ||
| 221 | (% contenteditable="false" tabindex="-1" %)[[image:Bar_measure_format_EN.png]](% title="Click and drag to resize" %) | ||
| 222 | |||
| 223 | (% start="8" %) | ||
| 224 | 1. In the **Labels **tab of the right-hand panel: | ||
| 225 | 1*. activate **Content of the bars**. | ||
| 226 | 1*. select the **Automatic font color** box. | ||
| 227 | (% contenteditable="false" tabindex="-1" %)[[image:Bar_chart_final_en.png]](% title="Click and drag to resize" %) | ||
| 228 | 1. Click **OK **at the bottom right of the window to save the {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}. | ||
| 229 | |||
| 230 | == Table listing the product families == | ||
| 231 | |||
| 232 | 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. | ||
| 233 | |||
| 234 | (% start="1" %) | ||
| 235 | 1. Create a new {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} of type **Table**. | ||
| 236 | 1. Select the data model and enter the name **Product family List**. | ||
| 237 | 1. Drag the **Product Family** dimension onto the **Column 1** axis. | ||
| 238 | 1. Click the sort button for the **Column 1** axis and apply an ascending alphabetical sort. | ||
| 239 | (% contenteditable="false" tabindex="-1" %)[[image:List of product families.png]](% title="Click and drag to resize" %) | ||
| 240 | |||
| 241 | (% start="5" %) | ||
| 242 | 1. Click **OK **at the bottom right of the edit window to save the {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}. | ||
| 243 | |||
| 244 | We have created all the charts required for the report. Now we're going to create the {{glossaryReference glossaryId="Glossary" entryId="Fabrique PDF"}}PDF builder{{/glossaryReference}}. | ||
| 245 | |||
| 246 | = Step 3: Configure the {{glossaryReference glossaryId="Glossary" entryId="Fabrique PDF"}}PDF builder{{/glossaryReference}} = | ||
| 247 | |||
| 248 | (% class="box infomessage" %) | ||
| 249 | ((( | ||
| 250 | ℹ This entire part of the tutorial takes place in the Studio. | ||
| 251 | ))) | ||
| 252 | |||
| 253 | ((( | ||
| 254 | (% role="presentation" %) | ||
| 255 | Here we're going to create and configure the PDF {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}}. We're going to add the graphics we created earlier, as well as text boxes, images, page numbers, etc. to create a complete report. | ||
| 256 | |||
| 257 | (% id="HCrE9ationetpropriE9tE9sdelafabriquePDF" role="presentation" %) | ||
| 258 | == Create and define the properties of the {{glossaryReference glossaryId="Glossary" entryId="Fabrique PDF"}}PDF builder{{/glossaryReference}} == | ||
| 259 | ))) | ||
| 260 | |||
| 261 | 1. From the {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} tab, create a new **PDF {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}}.** | ||
| 262 | 1. In the **Properties** tab, name this {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} **PDF Report**. | ||
| 263 | 1. Define the output name of the PDF file in the **Export name** field: tutorial_report_sales_${filter.Date}_${filter.Store Area}_${date.yyyyMMddhhmm}. | ||
| 264 | |||
| 265 | (% class="box infomessage" %) | ||
| 266 | ((( | ||
| 267 | 💡 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. | ||
| 268 | ))) | ||
| 269 | |||
| 270 | (% start="4" %) | ||
| 271 | 1. Click the **Editor** button. | ||
| 272 | (% contenteditable="false" tabindex="-1" %)[[image:New_PDF_builder_EN.png||height="609" width="929"]](% title="Click and drag to resize" %) | ||
| 273 | |||
| 274 | ➡ The PDF {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}} editor opens. Here we will configure the {{glossaryReference glossaryId="Glossary" entryId="Fabrique PDF"}}PDF builder{{/glossaryReference}} template. | ||
| 275 | |||
| 276 | ((( | ||
| 277 | == Modify the page parameters == | ||
| 278 | |||
| 279 | First of all, we're going to modify the page layout: | ||
| 280 | ))) | ||
| 281 | |||
| 282 | * In the **Settings **tab of the right-hand panel, change the document to **A4 landscape** format **(297 x 210 mm)**. | ||
| 283 | |||
| 284 | (% contenteditable="false" tabindex="-1" %)[[image:Page_size_EN.png]](% title="Click and drag to resize" %) | ||
| 285 | |||
| 286 | == Configure the cover page == | ||
| 287 | |||
| 288 | On the first existing page, which will act as the cover page, we're going to add : | ||
| 289 | |||
| 290 | * A header banner that will be repeated on each page (image) | ||
| 291 | * A footer banner that will be repeated on each page (image) | ||
| 292 | * Page numbering, repeated on each page (text) | ||
| 293 | * A logo (image) | ||
| 294 | * A title (text) | ||
| 295 | |||
| 296 | === Add the header banner === | ||
| 297 | |||
| 298 | To add the image corresponding to the header banner : | ||
| 299 | |||
| 300 | 1. Click the **Image** button. | ||
| 301 | 1. Click on an empty zone on the right-hand side of the page to create an image zone.((( | ||
| 302 | (% contenteditable="false" tabindex="-1" %)[[image:Add_image_area.png||alt="Add image" height="614" width="1138"]](% title="Click and drag to resize" %) | ||
| 303 | ))) | ||
| 304 | 1. Click on the (% contenteditable="false" tabindex="-1" %)[[image:1716900965745-365.png]](% title="Click and drag to resize" %)(%%) button in the created zone and then click **Edit** to open the **Icon Manager**. | ||
| 305 | (% contenteditable="false" tabindex="-1" %)[[image:Edit_image_area.png||alt="Edit image"]](% title="Click and drag to resize" %) | ||
| 306 | 1. In the **Indicators** tab, click **Add a custom icon**. | ||
| 307 | 1. 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. | ||
| 308 | (% contenteditable="false" style="border:none; color:#36525b; display:inline-block; font-family:~"Open Sans~",sans-serif; font-size:11pt; font-style:normal; font-variant:normal; font-weight:400; height:309px; overflow:hidden; text-decoration:none; white-space:pre-wrap; width:709px" tabindex="-1" %)[[image:Add_custom_icon.png||alt="Add icons"]](% title="Click and drag to resize" %) | ||
| 309 | |||
| 310 | (% start="6" %) | ||
| 311 | 1. In the **Icon Manager** window, select the image **_custom_pdf_tutorial_banner_top.png** then click **OK**. | ||
| 312 | |||
| 313 | 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: | ||
| 314 | |||
| 315 | * **X** (X coordinates from the left edge of the page) | ||
| 316 | * **Y** (Y coordinates from the top edge of the page) | ||
| 317 | * **W** (element width) | ||
| 318 | * **H** (height of the element) | ||
| 319 | |||
| 320 | (% class="box warningmessage" %) | ||
| 321 | ((( | ||
| 322 | ❗These values vary depending on the screen resolution. For the same positioning, the values in your editor may differ from the values illustrated here. | ||
| 323 | ))) | ||
| 324 | |||
| 325 | (% start="7" %) | ||
| 326 | 1. Resize it to the width of the page and position it at the top of the page. | ||
| 327 | 1. Click the (% contenteditable="false" tabindex="-1" %)[[image:1716900965745-365.png]](% title="Click and drag to resize" %)(%%) 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.(% contenteditable="false" tabindex="-1" %)[[image:1761559625798-796.png||alt="Header"]](% title="Click and drag to resize" %) | ||
| 328 | |||
| 329 | === Add the footer banner === | ||
| 330 | |||
| 331 | To add the footer banner, perform the same actions as above. For this element : | ||
| 332 | |||
| 333 | (% start="1" %) | ||
| 334 | 1. Select the image **_custom_pdf_tutorial_banner_bottom.png**. | ||
| 335 | 1. Resize it to the width of the page like the previous one and position it at the bottom of the page. | ||
| 336 | 1. Select the **Footer type**. | ||
| 337 | |||
| 338 | (% style="line-height: 1.2; text-align: justify;" %) | ||
| 339 | === Add the logo === | ||
| 340 | |||
| 341 | (% style="line-height:1.2; text-align:justify" %) | ||
| 342 | To add the logo : | ||
| 343 | |||
| 344 | 1. Click the **Image** button. | ||
| 345 | 1. Click on an empty zone on the right-hand side of the page to create an image zone. | ||
| 346 | 1. Click on the (% contenteditable="false" tabindex="-1" %)[[image:1716900965745-365.png]](% title="Click and drag to resize" %)(%%) button of the created area and then on **Edit**. | ||
| 347 | ➡ The **Icon Manager** appears. | ||
| 348 | 1. In the **Infographics** tab, click **Add a vector icon**. | ||
| 349 | (% contenteditable="false" tabindex="-1" %)[[image:Add_logo.png||alt="Add logo"]](% title="Click and drag to resize" %) | ||
| 350 | 1. Add the image **_custom_pdf_tutorial_logo_digdash.svg** (downloaded previously) | ||
| 351 | 1. Select it and click **OK.** | ||
| 352 | 1. Resize it and position it as shown below: | ||
| 353 | (% contenteditable="false" tabindex="-1" %)[[image:Logo_added.png||alt="Logo added"]](% title="Click and drag to resize" %) | ||
| 354 | |||
| 355 | (% style="line-height: 1.2; text-align: justify;" %) | ||
| 356 | === Add text === | ||
| 357 | |||
| 358 | (% style="line-height:1.2; text-align:justify" %) | ||
| 359 | To add text : | ||
| 360 | |||
| 361 | 1. Click the **Text** button. | ||
| 362 | 1. Click on an empty area of the page on the right to create a text zone. | ||
| 363 | 1. Click the menu button of the zone you have created and then click **Edit**. | ||
| 364 | 1. In the text zone, fill in the texts below, adding a line break between them: | ||
| 365 | 1*. Sales indicators report | ||
| 366 | 1*. Report date: ${date.dd/MM/yyyy} | ||
| 367 | 1. Select the first line of text, set the font size to 72 and centre. | ||
| 368 | 1. Select the second line of text, set the font size to 16 and centre. | ||
| 369 | (% contenteditable="false" tabindex="-1" %)[[image:1761560662340-512.png||alt="Add text" height="727" width="1188"]](% title="Click and drag to resize" %) | ||
| 370 | 1. Click** OK**. | ||
| 371 | 1. Resize and position the text box as shown below: | ||
| 372 | (% contenteditable="false" tabindex="-1" %)[[image:Title_EN.png]](% title="Click and drag to resize" %) | ||
| 373 | |||
| 374 | === Add page numbers === | ||
| 375 | |||
| 376 | To add page numbering: | ||
| 377 | |||
| 378 | 1. Click the **Page Number** button and then select **Page Number (Footer)**. | ||
| 379 | ➡ Page numbering is added automatically at the bottom right of the page.(% contenteditable="false" tabindex="-1" %)[[image:1761560858292-834.png]](% title="Click and drag to resize" %) | ||
| 380 | |||
| 381 | (% style="line-height:1.2; text-align:justify" %) | ||
| 382 | The cover page is now complete. We're going to add a new page to our PDF. To do this, click on the **+ **button on the toolbar above the page. | ||
| 383 | |||
| 384 | (% style="line-height: 1.2;" %) | ||
| 385 | You can switch between the different pages using the arrows at the bottom. | ||
| 386 | (% contenteditable="false" tabindex="-1" %)[[image:1761560955181-181.png||alt="Pages"]](% title="Click and drag to resize" %) | ||
| 387 | |||
| 388 | (% style="line-height: 1.2;" %) | ||
| 389 | == Configuring the summary page == | ||
| 390 | |||
| 391 | (% style="line-height:1.2; text-align:justify" %) | ||
| 392 | In this second page, which will be the summary of the sales indicators, we are going to add : | ||
| 393 | |||
| 394 | * A title (text) | ||
| 395 | * 2 description texts (text) | ||
| 396 | * Charts: | ||
| 397 | ** Summary table of sales by product family | ||
| 398 | ** Monthly sales strend | ||
| 399 | ** Map of sales by region | ||
| 400 | |||
| 401 | (% style="line-height: 1.2; text-align: justify;" %) | ||
| 402 | === Add title === | ||
| 403 | |||
| 404 | (% style="line-height:1.2; text-align:justify" %) | ||
| 405 | To add a title : | ||
| 406 | |||
| 407 | 1. Click the **Text** button. | ||
| 408 | 1. Click on an empty zone on the right-hand side of the page to create a text zone. | ||
| 409 | 1. Click the menu button of the zone you have created and then click **Edit.** | ||
| 410 | 1. In the text editor, enter the title: //Global summary//. | ||
| 411 | 1. Set the font size to 28 and centre | ||
| 412 | 1. Click **OK**. | ||
| 413 | 1. Resize the text box and position it as follows: | ||
| 414 | (% contenteditable="false" tabindex="-1" %)[[image:1761561275537-578.png||alt="Title page2"]](% title="Click and drag to resize" %) | ||
| 415 | |||
| 416 | (% style="line-height: 1.2; text-align: justify;" %) | ||
| 417 | === Add the description texts === | ||
| 418 | |||
| 419 | (% style="line-height:1.2; text-align:justify" %) | ||
| 420 | To add the description texts, follow the same steps as above: | ||
| 421 | |||
| 422 | 1. In the first text box, enter the following text: //Below is a table summarising the sales achieved by the different product families for the year _KEYWORD_YEAR_ compared with the previous year.// | ||
| 423 | |||
| 424 | (% class="box infomessage" %) | ||
| 425 | ((( | ||
| 426 | **_KEYWORD_YEAR_** is a keyword that will be replaced by the value for the year selected when the PDF report is generated. | ||
| 427 | ))) | ||
| 428 | |||
| 429 | (% start="2" %) | ||
| 430 | 1. In the second text box, enter the following text: //The following pages detail sales by product family//. | ||
| 431 | 1. Resize and position the text boxes to obtain a result similar to the illustration below:(% contenteditable="false" tabindex="-1" %)[[image:1761561525732-378.png||alt="Desc textes"]](% title="Click and drag to resize" %) | ||
| 432 | |||
| 433 | === Add charts === | ||
| 434 | |||
| 435 | To add charts : | ||
| 436 | |||
| 437 | 1. In the **{{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}{{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} by role** tab on the left-hand panel, select the role containing your charts. | ||
| 438 | 1. Find the chart **Summary of sales by product family**. | ||
| 439 | 1. Drag and drop it from the list of Flows onto the page. | ||
| 440 | 1. Do the same for the other 2 charts: **Monthly sales trend** and **Sales by region**. | ||
| 441 | 1. Resize and position the chart areas to obtain the following model:(% contenteditable="false" tabindex="-1" %)[[image:1761562067723-882.png||alt="Charts added"]](% title="Click and drag to resize" %) | ||
| 442 | |||
| 443 | (% class="box infomessage" %) | ||
| 444 | ((( | ||
| 445 | 💡 You can multi-select the flows (Ctrl + left-click) to drag and drop several simultaneously. | ||
| 446 | ))) | ||
| 447 | |||
| 448 | (% start="6" %) | ||
| 449 | 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. | ||
| 450 | (% contenteditable="false" tabindex="-1" %)[[image:Final_rendering_page2.png||alt="Final rendering"]](% title="Click and drag to resize" %) | ||
| 451 | |||
| 452 | Now that the summary page is complete, we're going to add a new page to our PDF. To do this, click the **+** button as done previously. | ||
| 453 | |||
| 454 | == Configure the detail page == | ||
| 455 | |||
| 456 | In this third page, which will detail the sales indicators by product family, we are going to add : | ||
| 457 | |||
| 458 | * A title (text) | ||
| 459 | * A description (text) | ||
| 460 | * Charts: | ||
| 461 | ** Table of sales by month | ||
| 462 | ** Comparison of sales by product | ||
| 463 | ** Sales by region | ||
| 464 | |||
| 465 | 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). | ||
| 466 | |||
| 467 | === Add a title === | ||
| 468 | |||
| 469 | (% style="line-height:1.2; text-align:justify" %) | ||
| 470 | To add the title : | ||
| 471 | |||
| 472 | 1. Click the **Text** button. | ||
| 473 | 1. Click on an empty zone on the right-hand side of the page to create a text zone. | ||
| 474 | 1. Click on the menu button of the zone you have created and then click **Edit**. | ||
| 475 | 1. In the text box, enter the following text: **Detail for product family _KEYWORD_CATEGORY_** | ||
| 476 | |||
| 477 | (% class="box infomessage" %) | ||
| 478 | ((( | ||
| 479 | 💡 **_KEYWORD_CATEGORY_** is a keyword which will be replaced by the value of the product family concerned when the PDF report is generated. | ||
| 480 | ))) | ||
| 481 | |||
| 482 | (% start="5" %) | ||
| 483 | 1. Select the text then set the font size to **28** and centre. | ||
| 484 | 1. Click **OK**. | ||
| 485 | 1. Resize and position the text box as shown below: | ||
| 486 | (% contenteditable="false" tabindex="-1" %)[[image:Page3.png]](% title="Click and drag to resize" %) | ||
| 487 | |||
| 488 | (% style="line-height: 1.2; text-align: justify;" %) | ||
| 489 | === Add charts === | ||
| 490 | |||
| 491 | (% style="line-height:1.2; text-align:justify" %) | ||
| 492 | To add charts : | ||
| 493 | |||
| 494 | 1. In the **{{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} by Role** tab of the left-hand panel, select the role containing your charts. | ||
| 495 | 1. Drag and drop the **Table of sales by month** from the left-hand panel onto the page. | ||
| 496 | 1. Do the same for the other 2 charts: **Comparison of sales by product** and **Sales by region**. | ||
| 497 | 1. Resize and position the chart areas to obtain the following model:(% contenteditable="false" tabindex="-1" %)[[image:1761562776028-594.png||alt="Charts added"]](% title="Click and drag to resize" %) | ||
| 498 | 1. As on the previous page, activate **Final rendering **to check the rendering. | ||
| 499 | |||
| 500 | (% class="box infomessage" style="line-height: 1.2; text-align: justify;" %) | ||
| 501 | ((( | ||
| 502 | (% style="text-align: left;" %) | ||
| 503 | 💡 If there are too many elements on your page, you can access each element from the **Objects on the page **tab and then access their properties by right-clicking on them. | ||
| 504 | |||
| 505 | (% style="text-align: left;" %) | ||
| 506 | [[image:1761562852923-601.png]](% title="Click and drag to resize" %) | ||
| 507 | |||
| 508 | (% style="text-align: left;" %) | ||
| 509 | Adding a section | ||
| 510 | |||
| 511 | (% style="text-align: left;" %) | ||
| 512 | |||
| 513 | ))) | ||
| 514 | |||
| 515 | (% class="wikigeneratedid" %) | ||
| 516 | We're going to define a section to display this third page for each product family. To do this | ||
| 517 | |||
| 518 | 1. Select the **Sections** tab in the right-hand panel. | ||
| 519 | 1. The index corresponds to the page number. Select index **3** then click on **Add...** | ||
| 520 | ➡ The **Section Source** dialog box is displayed. | ||
| 521 | 1. Select the role used and then the **Product family list** table. | ||
| 522 | [[image:1761569086754-132.png||alt="Add sections"]](% title="Click and drag to resize" %)(% aria-label="Ajout section image widget" contenteditable="false" role="region" style="background:url(~"https://doc.digdash.com/xwiki/webjars/wiki%3Adev/xwiki-platform-ckeditor-webjar/15.10.7/plugins/widget/images/handle.png~") rgba(220, 220, 220, 0.5); left:0px; top:-15px" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% aria-label="Ajout section image widget" contenteditable="false" role="region" tabindex="-1" title="Click and drag to resize" %) | ||
| 523 | 1. Click **OK**. | ||
| 524 | ➡ The section is added. It is also displayed below the page. | ||
| 525 | [[image:1761569191383-689.png||alt="Sections added"]](% title="Click and drag to resize" %)(% aria-label="Section ajoutée image widget" contenteditable="false" role="region" style="background:url(~"https://doc.digdash.com/xwiki/webjars/wiki%3Adev/xwiki-platform-ckeditor-webjar/15.10.7/plugins/widget/images/handle.png~") rgba(220, 220, 220, 0.5); left:0px; top:-15px" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% aria-label="Section ajoutée image widget" contenteditable="false" role="region" tabindex="-1" title="Click and drag to resize" %) | ||
| 526 | |||
| 527 | (% class="wikigeneratedid" %) | ||
| 528 | The template is now complete. Click **OK** at the bottom right of the window to save it and close the editor. | ||
| 529 | |||
| 530 | == Configure word substitution == | ||
| 531 | |||
| 532 | 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: | ||
| 533 | |||
| 534 | 1. In the **Properties **tab of the **{{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} Properties** box, click **Configure**. | ||
| 535 | (% aria-label="Configurer image widget" contenteditable="false" role="region" tabindex="-1" %)[[image:Configure_button.png||height="589" width="826"]](% title="Click and drag to resize" %)(% aria-label="Configurer image widget" contenteditable="false" role="region" style="background:url(~"https://doc.digdash.com/xwiki/webjars/wiki%3Adev/xwiki-platform-ckeditor-webjar/15.10.7/plugins/widget/images/handle.png~") rgba(220, 220, 220, 0.5); left:0px; top:-15px" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% aria-label="Configurer image widget" contenteditable="false" role="region" tabindex="-1" title="Click and drag to resize" %) | ||
| 536 | 1. Open the **Word Substitution** tab. | ||
| 537 | 1. Click the **Add...** button. | ||
| 538 | 1. In the **Key** field,** **enter the keyword **_KEYWORD_CATEGORY_.** | ||
| 539 | 1. In the **Value** field, enter **${filter.Product Family}** then click** OK.** | ||
| 540 | (% title="Click and drag to resize" %)(% aria-label="Substitution de mots image widget" contenteditable="false" role="region" style="background:url(~"https://doc.digdash.com/xwiki/webjars/wiki%3Adev/xwiki-platform-ckeditor-webjar/15.10.7/plugins/widget/images/handle.png~") rgba(220, 220, 220, 0.5); left:0px; top:-15px" tabindex="-1" %)[[image:Word_substituionb_EN.png||alt="Word substitution"]](% aria-label="Substitution de mots image widget" contenteditable="false" role="region" tabindex="-1" title="Click and drag to resize" %) | ||
| 541 | 1. Repeat the operation to add a second substitution: | ||
| 542 | 1*. In the **Key** field, enter the keyword **_KEYWORD_YEAR_.** | ||
| 543 | 1*. In the** Value** field, enter **${filter.Date}** | ||
| 544 | 1. Click **OK**. | ||
| 545 | |||
| 546 | The {{glossaryReference glossaryId="Glossary" entryId="Fabrique PDF"}}PDF builder{{/glossaryReference}} is now complete. | ||
| 547 | We will now create a dashboard with a button to run the PDF {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}}. | ||
| 548 | |||
| 549 | = Step 4: Create the dashboard and generate the PDF report = | ||
| 550 | |||
| 551 | (% class="box infomessage" style="line-height: 1.2; text-align: justify;" %) | ||
| 552 | ((( | ||
| 553 | ℹ This part of the tutorial takes place in the Dashboard Editor and then in the Dashboard. | ||
| 554 | ))) | ||
| 555 | |||
| 556 | == Create the dashboard page == | ||
| 557 | |||
| 558 | To create the **PDF Report **dashboard page **:** | ||
| 559 | |||
| 560 | 1. Launch the Dashboard Editor. | ||
| 561 | 1. Select the role you are using. | ||
| 562 | 1. Click the **+** button to create a new dashboard page and name it **PDF Report**. | ||
| 563 | (% aria-label="New page image widget" contenteditable="false" role="region" tabindex="-1" title="Click and drag to resize" %)[[image:PDf_report_page.png||alt="new page"]] | ||
| 564 | |||
| 565 | == Add a {{glossaryReference glossaryId="Glossary" entryId="Fabrique PDF"}}PDF builder{{/glossaryReference}} run button == | ||
| 566 | |||
| 567 | We're now going to add a button that will allow us to generate the PDF report from the dashboard page. | ||
| 568 | |||
| 569 | 1. From the **Additional content** tab, drag and drop a button onto the newly created empty page. | ||
| 570 | 1. Select the button and in the **Display** section of the right-hand panel, enter **PDF report** in the **Text** field. | ||
| 571 | 1. In the **Actions** section, click the **Add** button. | ||
| 572 | 1. In the **Action** dialog box, select the **Execute a PDF document factory {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}** action and then select the **PDF Report** flow. | ||
| 573 | (% title="Click and drag to resize" %)(% aria-label="Ajout bouton PDF image widget" contenteditable="false" role="region" style="background:url(~"https://doc.digdash.com/xwiki/webjars/wiki%3Adev/xwiki-platform-ckeditor-webjar/15.10.7/plugins/widget/images/handle.png~") rgba(220, 220, 220, 0.5); left:0px; top:-15px" tabindex="-1" %)[[image:PDf_report_button.png]] | ||
| 574 | 1. (% aria-label="Ajout bouton PDF image widget" contenteditable="false" role="region" tabindex="-1" title="Click and drag to resize" %)Click **OK**. | ||
| 575 | |||
| 576 | == Add a Date filter == | ||
| 577 | |||
| 578 | Here we add a Date filter which will allow us to select the desired year for the report. | ||
| 579 | |||
| 580 | 1. As it is not possible to add a filter to a page that does not contain any charts, add the **Sales by region** chart from the **Information flow** **(Existing graphics) **tab** **on the page. | ||
| 581 | (% aria-label="Ajout graphique image widget" contenteditable="false" role="region" tabindex="-1" %)[[image:Add_graph_dashboard_FR.png||alt="Ajout graphique"]](% title="Click and drag to resize" %)(% aria-label="Ajout graphique image widget" contenteditable="false" role="region" tabindex="-1" %) | ||
| 582 | 1. From the **Filters/Variables** tab, add a filter on the **Date** dimension. | ||
| 583 | 1. In the filter properties panel, select **Date** and **Year **from the** Hierarchy **and **Level** drop-down lists. | ||
| 584 | 1. The report data will be filtered on a given year. In the **Display** section of the same panel: | ||
| 585 | 1*. Check the **Hide element "All" **box **.** | ||
| 586 | 1*. Check the box **Prohibit empty selection**. | ||
| 587 | 1*. Uncheck the **Multiple selection** box. | ||
| 588 | [[image:1761570830693-331.png||alt="Add filter"]](% title="Click and drag to resize" %)(% aria-label="Add_filter_date_FR.png image widget" contenteditable="false" role="region" tabindex="-1" %) | ||
| 589 | |||
| 590 | == Generate the PDF report == | ||
| 591 | |||
| 592 | Now we just have to access the Dashboard and generate the PDF report. | ||
| 593 | |||
| 594 | 1. Click the Dashboard access button (% aria-label="Accès Dashboard image widget" contenteditable="false" role="region" tabindex="-1" %)[[image:1738571706912-923.png||alt="Accès Dashboard"]](% title="Click and drag to resize" %)(% aria-label="Accès Dashboard image widget" contenteditable="false" role="region" tabindex="-1" %)(%%) and save your changes.(% aria-label="Save_DB_message_FR.png image widget" contenteditable="false" role="region" tabindex="-1" title="Click and drag to resize" %) | ||
| 595 | 1. In the dashboard, select a year and then click the **PDF report** button to generate a PDF report. | ||
| 596 | |||
| 597 | For example, if we select 2024, we get the following report [[tutorial_report_sales_2024_All_202510270246.pdf>>attach:tutorial_report_sales_2024_All_202510270246.pdf]] . | ||
| 598 | |||
| 599 | If we filter geographically at country level for France for the year 2018, we obtain the following report [[tutorial_report_sales_2023_France_202510270250.pdf>>attach:tutorial_report_sales_2023_France_202510270250.pdf]] | ||
| 600 | |||
| 601 | = Congratulations! = | ||
| 602 | |||
| 603 | You've successfully created your first PDF {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}}. | ||
| 604 | Now all you have to do is create your own report using your data! |