TL1: Enhance a Non Print Management Report

Welcome to Training Lesson #1 | Download Training Lab Resources

Exercise 1: Enhance only the design of the report

Help yourself with this tutorial >>

  • Register the HcmNumberOfWorkersReport.Report SSRS report design as a Docentric report.
  • Open the report dialog form: Human resources -> Workers -> Inquiries and reports -> Number of workers report and generate the DDSP (Docentric Data Source Package) file using the Generate DS print destination.
  • Design a template, by starting from the finished document: Docentric AX Training D365FO Resources\01-HcmNumberOfWorkersReport\NumberOfWorkers_StartingDocumentForTemplate.docx.

    Open the document -> Click the DOCENTRIC AX ribbon -> Click the Use As Template button -> Load the generated DDSP file. Design the template from scratch with the help of this step by step tutorial.

    Resulting template: Docentric AX Training D365FO Resources\01-HcmNumberOfWorkersReport\HcmNumberOfWorkersReport.Report_WithoutLabels.docx

  • Assign the template to the report in Docentric report setup and run the report from D365FO.
    Note that you can save Docentric templates as AOT resources but also in Azure Blob storage, SharePoint or File system. Learn more >>
  • Change the design of the report: Move the two Total rows (Total Project Operations and Grand Total) to the end of the table.

    Resulting template: Docentric AX Training D365FO Resources\01-HcmNumberOfWorkersReport\HcmNumberOfWorkersReport.Report_SeparatedGrandTotal.docx

  • Change the design of the report: For both rows (Total Project Operations and Grand Total) apply the following conditional formatting. Set the text color to red and change font to italic in case that number of workers is < 500. Otherwise, set the text color to black.

    Resulting template: Docentric AX Training D365FO Resources\01-HcmNumberOfWorkersReport\HcmNumberOfWorkersReport.Report_ConditionalFormatting.docx

To use a different template (e.g. HcmNumberOfWorkersReport.Report_SeparatedGrandTotal.docx instead of HcmNumberOfWorkersReport.Report_WithoutLabels.docx) make the first one default, by clicking the Set default button in the Report templates tab on the Docentric reports form.
Learn more about using more than one template for the same report >>

Exercise 2: Use improved print destinations

Help yourself with this tutorial >>

Exercise 3: Using labels

  • In Docentric report setup add the following custom labels:

    @SYS4083 (From), @SYS13342 (Company), @SYS342806 (Department name), @SYS324440 (Department number), @SYS326475 (Full-time workers).

  • Instead of adding them manually, you can import the report setup data from within the same form, using the file: HcmNumberOfWorkersReport.Report.Metadata.xml.
  • Regenerate the DDSP file, load it into the template and use the system and custom labels for the report title and table header.

    Resulting template: Docentric AX Training D365FO Resources\01-HcmNumberOfWorkersReport\HcmNumberOfWorkersReport.Report.docx

Exercise 4: Adding additional data

  • We can add additional data in the standard way – using the original SSRS report artifacts: RDP table and RDP class, regenerate the DDSP file, load it into the template and redesign it to show the added data. Or, we can use Docentric approach by taking the steps that follow.
  • Create a custom DSP (Data Source Provider) class for the report using the VS DSP class template and name it as DTHcmNumberOfWorkersReportDSP.
  • Assign this class to the HcmNumberOfWorkersReport.Report report in Docentric report setup.
  • Put breakpoints in each method generated by the wizard to understand a Docentric DSP class pipeline.

For the next exercises help yourself with this tutorial >>

Exercise 4.1: Append additional data

You will extend the generateXmlDataSource() method, working with the RecordBuilder (i.e. DocXmlRecordBuilder) object.

  • TASK #1: Export generated XML to a string or a file to check the resulting report DS (data source): _recordBuilder.exportToXmlFile('NumberOfWorkersDs.xml');
  • TASK #2: Append additional info about the maximum number of workers of all departments to the end of the report data source as a data field.
  • TASK #3: Append additional info about the department with the maximum number of workers to the end of the report data source as a data record.
  • TASK #4: Append an additional data set, i.e. data records of a different type. For example, add the first five workers (Name and Title) from the department with the maximum number of workers.
  • Regenerate the DDSP file, load it into the template and redesign the template to show the appended data.

    Resulting template: Docentric AX Training D365FO Resources\01-HcmNumberOfWorkersReport\HcmNumberOfWorkersReport.Report_AdditionalData.docx

Exercise 4.2: Add additional data to the each line of the report RDP table

You will extend the addDataFieldsForRdpTableRecord() method, working with the DataRecord (i.e. DocXmlRecord) and DataField (i.e. DocXmlField) objects.

  • TASK #5: Add additional info about the manager for each department in the list.
  • TASK #6: Exclude the fields DepartmentRecId and ParentNumber from the report DS.
You can use the DocCodeGeneratorHelper class to generate the code for all or filtered fields, display methods and field groups.

Exercise 4.3: Add additional data set to the each line of the report RDP table

You will plant this code in the addDataFieldsForRdpTableRecord() method, working with the DataRecord (i.e. DocXmlRecord) and DataField (i.e. DocXmlField) objects.

  • TASK #7: Add a (sub)list of the first 5 workers for each department in the list.
  • TASK #8: Rename the new data record from HcmWorker to Workers.
  • Regenerate the DDSP file, load it into the template and redesign the template to show the added data on template – design a sublist Workers for each department, including IF element to hide the sublist if there is no worker in the current department.

    Resulting template: Docentric AX Training D365FO Resources\01-HcmNumberOfWorkersReport\HcmNumberOfWorkersReport.Report_AdditionalDataSublines.docx

IN THIS ARTICLE