TL2: Enhance a Print Management Report
Exercise 1: Enhance only the design of the report
Help yourself with this tutorial >>
- Register the PurchPurchaseOrder.Report SSRS report design as a Docentric report.
- Generate DDSP using the Generate DS print destination from the Print Management setup.
- Generate DDSP using the Generate DDSP when report runs option from Docentric report setup.
- Design a template, by starting from the finished document: Docentric AX Training D365FO Resources\02-PurchPurchaseOrderReport\PurchaseOrder_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. Also use the Barcode tagging element with the QR symbology and bind it to PurchId.
Resulting template: Docentric AX Training D365FO Resources\02-PurchPurchaseOrderReport\PurchPurchaseOrder.Report.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 >>
Exercise 2: 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 DTPurchPurchaseOrderDSP.
- Assign this class to the PurchPurchaseOrder.Report report in Docentric report setup.
For the next exercises help yourself with this tutorial >>
Exercise 2.1: Append additional data to the end of the report DS
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: _recordBuilder.exportToXmlFile('PurchPurchaseOrderDs.xml');
- TASK #2: Store values into global class variables in the onSelectedRdpTableRecord() method and append additional data from PurchTable using these stored values.
- TASK #3: Conditionally load a subdocument (Docentric AX Training D365FO Resources\02-PurchPurchaseOrderReport\TermsAndConditions.docx).
Exercise 2.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 #4: Add additional data to the header, exclude fields related to the company.
- TASK #5: Add additional data to each of the report lines and exclude all unnecessary fields for the sake of performance.
- Redesign the template to show additional data.
Resulting template: Docentric AX Training D365FO Resources\02-PurchPurchaseOrderReport\PurchPurchaseOrder.Report_AdditionalData.docx