How to Improve an SSRS Report Design
In this tutorial we will demonstrate how to use a Docentric design (aka Docentric template) instead of a built-in SSRS report design for Non Print Management reports.
A plain built-in SSRS report example: Number of workers
You can print the built-in Number of workers report by clicking the Human resources -> Inquiries and reports -> Number of workers menu item.
When the OK button on the open report dialog form is clicked, the built-in SSRS report viewer is open showing report generated using the built-in SSRS report design that is named HcmNumberOfWorkersReport.Report.
To improve this original design, you will use Docentric design (aka Docentric template) instead.
1. Register report in Docentric report setup
In order to use a Docentric design (aka Docentric template) instead of a built-in SSRS report design, you need to register this design as Docentric report.
The Reports form, or Docentric report setup, can be open from the Docentric AX workspace, or from the Organization administration module menu. The Docentric AX workspace is also located in the default dashboard among other workspaces.
In the Docentric AX workspace click on the Reports tile.
Docentric's report setup form is open, with all SSRS report designs registered to use Docentric AX functionality listed.
Locate and add the HcmNumberOfWorkersReport.Report SSRS report design to Docentric AX Reports.
You will also notice that this report is automatically validated. However, validation is not triggered automatically once report is inserted. Validation message is only for your information, to check if your DSP class is valid, if Docentric templates exist and are valid, etc.
When a new SSRS report design is registered in Docentric report setup, the Docentric Default DSP class is used. This class is a part of Docentric AX Framework, and enables reusing of the existing SSRS report data sets. If you want to add additional data to the report data source, you can create and use a custom Docentric DSP class. You will also need a custom DSP class to be able to use Custom placeholders in print destinations.
2. Generate DDSP
Docentric templates are ordinary Word documents designed in MS Word with the help of Docentric AX Designer, which is not connected to the D365FO application in any way. This could be beneficial when you want to outsource template design or give it over to your end-users or functional consultants.
To enable such 'off-line' design process, we need to produce report data schema and then to import it into the template. For that purpose, a new print destination is introduced: Generate DS. This destination can be also hidden (e.g. in production) in Docentric AX parameters.
You will be able to switch between SSRS and Docentric print destinations if Print destination settings mode in Docentric AX parameters allows this.
The result of printing a report to the Generate DS print destination is a DDSP file for this report (DDSP - Docentric Data Source Package), which consists of report data schema, sample data and System and Custom report labels. Sample data are the data that would be shown in the generated report, if we have chosen a different print destination, e.g. Screen. These data will used to preview report 'off-line', i.e. directly from within Docentric AX Designer.
On the Print destination settings form you can also specify Preview languages, which will enable Multilingual preview from the designer (see the next step).
3. Design Docentric template
Docentric templates are Word documents that you will designed in MS Word with the help of Docentric AX Designer, a special MS Word Add-In. When you design report from scratch, open MS Word and create a new Word document. Open the Docentric AX ribbon tab and click the Use As Template button. Locate and select the report DDSP file. In the Data Source pane you can see the report data source schema. Design report.
4. Register template in Docentric report setup
Docentric templates can be stored as AOT Resources. This way you will deliver Docentric templates to your customer via regular deployments.
When you create a new AOT Resource pointing to a Docentric template, you need to build the belonging project/model first. Afterwards, you can assign it to the corresponding report in two ways.
The first way is to use the Reload system templates functionality to fill Docentric report setup automatically. If you want to have more control on how Docentric report setup is filled, you can decorate the Tags property of the corresponding template's AOT Resource with a specific Template ID, Language ID, Company ID, or Report Group ID. Otherwise the default values will be used, e.g. a template filename will be used as Template ID.
In Docentric report setup open the Number of workers report and click the Reload system templates button in the Templates tab page. The newly added System Template will appear.
Alternatively, you can register a new template by clicking the Add button in the Template tab page. After that you need to click the Template file -> Attach button. When the Report template file form is open, you will be able to select your template from the Resource name combo box on the File location – AOT Resource tab page.
You can also keep Docentric template on Azure, SharePoint, File system, or in combination with AOT Resources. This enables design changes also in production.
5. Generate report with improved design
When the report is printed to the Docentric Screen print destination, Docentric Report Viewer is used showing the report generated using the Docentric design (Docentric template: HcmNumberOfWorkersReport.Report.docx) that we have previously assigned to the report in the report setup.
Custom report labels
Report data tables and fields are usually accompanied by System labels that can be used out-of-the-box from within Docentric AX Designer. In case that these System labels are not sufficient, you can add so called Custom labels to the report on the report setup form.
Custom labels will be available at design time, if the DDSP file is generated after they are added to the report setup data.
Alternatively, you can use Ad-hoc labels in Docentric AX Designer, by entering the needed label code.
Updating Docentric template with new DDSP
You will need to regenerate the DDSP file for the report when:
- You added additional data, i.e. change data source schema of the report, either by updating the built-in SSRS artifacts (the RDP tables and the RDP class), or by creating and using a custom Docentric DSP class for the report. See how >>
- You added custom labels to the report in Report setup.
- You need new sample data to have more credible preview from within Docentric AX Designer.
When the DDSP file is regenerated, load it in the template and change the design.