How to Use a Print Management SSRS report as Docentric Report

Our goal in this tutorial is to show how to turn a Print Management SSRS Report (Design) into a Docentric report in order to improve its design, updating and management in general.

One Docentric report can replace a single SSRS Report Design.

Some of the Print Management SSRS Reports are Invoice, Purchase order, Request for quotation, Picking list etc. Let’s say we want to improve the Purchase order SSRS report from the Procurement and sourcing module with the Docentric functionality. Before we begin, let's take a look at the built-in Purchase order report. Navigate to Company/Procurement and sourcing/Common/Purchase orders and click the All purchase orders menu item. Navigate to the Purchase action pane on the Purchase orders list page and click the Purchase order confirmations button in the Journals button group. The Purchase order confirmations form is opened.

By clicking the Preview/Print -> Original preview button, the built-in Purchase order report is shown.

Enhance only report design

In order to turn a built-in SSRS Report Design into a Docentric report we need to take the following steps:

  • Register an SSRS Report Design as Docentric report
  • Generate the report Data Source Package
  • Create and design at least one report template (i.e. report layout, i.e. design), so called the default template

Learn more >>

Add additional data to a report

In case we need to add additional data to the report, the following has to be done:

  • Create a custom DSP (Data Source Provider) class
  • Implement the generateXmlDataSource() method of this class to add additional data
  • Regenerate the report Data Source Package
  • Update the affected report templates

Learn more >>

Use more than one template per report

Different templates for different companies and languages can be used for one SSRS Report Design. When a report runs, a single template is automatically selected considering the run-time language and company. Templates can be also company and language neutral.

Learn more >>

1. Register a SSRS report as Docentric Report

Let’s start with our task. First, we need to register Purchase order as a Docentric report. In order to do that, we need to find out the name of the corresponding SSRS Report and the used Report Design. We can easily do that by opening the PurchPurchaseOrderOriginal menu item behind the menu item button of the same name on the VendPurchOrderJournal form.

We can see that the Purchase order report comprises the PurchPurchaseOrder SSRS Report with the Report Report Design.

Now navigate to Company/System administration/Area page and under Setup section you will see the Docentric AX menu, specifically the Reporting submenu. The Reporting submenu includes functionalities related to management of both Docentric SSRS and Basic reports.

Click the Reports menu item. The Docentric reports form opens. Click the New SRS report button and select PurchPurchaseOrder as SRS report name and Report as Report design name.

In order to turn on the Docentric functionalities with the added SSRS report (i.e. SSRS Report Design) we have to select the Is active (SRS only) check box.

Docentric’s enhancement of an SSRS report can be easily turned on or off by using the is active flag. Also, built-in SSRS print destinations and the original report template (i.e. the original SSRS Report Design) can be also used for a currently active Docentric SSRS report. This feature can actually be set up – check the Reporting parameters form located in Company/System administration/Setup/Docentric AX/Reporting, on the SRS reports tab page. Read more >>

2. Generate the report Data Source Package

To design a report template with the Docentric AX designer we need a report data source saved in a physical file. This file is called Docentric Data Source Package (DDSP file). In other words, to be able to design a template for a report, we need to generate a corresponding DDSP file first.
Generating Data Source Package (“Generate DS”) is one of the report print destinations and can be turned off when needed through the Generate data source option. We can also set up the Include company logo and Include hidden parameters options for generating the Data Source Package for a report.

Now go to the Company/Procurement and sourcing/Setup/Forms menu and click the Form setup menu item. On the Form setup form click the Print management button.

Select the Purchase order -> Original node and click the marked button to select the print destination which will be used when the Use print management button is clicked.

The Print destination settings form is opened. Select the Generate DS print destination and enter Data Source file name.

Navigate back to Company/Procurement and sourcing/Common/Purchase orders, open the Purchase orders list page and click the Purchase order confirmations button in the Journals button group on the Purchase action pane. The Purchase order confirmations form is opened. Click the Use print management button on the form.

DDSP file for the Purchase order report is generated and saved to the file location we’ve specified.

Click the Open file location button to access the generated DDSP file.

Each Docentric report has exactly one Data Source Package and one or more templates. All report templates have to use the same Data Source Package.

About Docentric Data Source Packages (DDSP files) that represent design-time data sources intended for designing templates of Docentric documents and reports you can learn more here.

3. Create the template and assign it to the report

3.1. Create and design the report template

Docentric AX report templates are ordinary Word documents. Hence, create a new blank Word document and store it on file system or SharePoint Document Library depending on which template storage type you are using. You don’t have to store DDSP files along report template files nor you need to follow any naming convention for them although it’s always recommended to enforce one.

To create a new template you can always start from a blank Word document. However, the best practice is to copy and use in advanced prepared template that already defines company specific styles, headers and footers. This way you can easily achieve consistent look of all business documents companywide.

Open the newly created Word document, click the Use As Template button on the Docentric AX ribbon and load the report DDSP (Docentric Data Source Package) file.

Template design takes place in Docentric AX Template Designer, which is actually MS Word with a special Add-In. In the Data Source pane we can see the report data source schema as defined by the Data Source Package and that is at our disposal for template design. Notice that Docentric AX Framework automatically adds some common or general data (such as company or current worker) that might be used on every template.

At this point we will create a new template without any content. We will return to design of the template later after we have assigned it to the report and made sure it runs properly.

We have added only the dynamic title of the report. We can test the template by clicking the Preview button on the Docentric AX ribbon.

3.2. Assign the template to the report

The next step is to assign the newly created template to the Purchase order (PurchPurchaseOrder.Report) report. Open the Reports form, select the PurchPurchaseOrder.Report report and click the Add button on the Report templates tab page. On the Report template form click the marked button and select the report template file.

By clicking the OK button on the Report template form the new template with PurchPurchaseOrder.Report as Template ID is added to Report templates of the report as its default template.

When a Docentric SSRS report is executed, one of the default templates is used. If we want to use a non-default template, then we have to create a custom Data Source Provider class and implement its overrideReportRunSettings() method. Learn how >>
Template ID has to be globally unique across all Docentric reports. Identical Template IDs can be used for more templates of a single report as long as they have been set up for the different companies and languages. If the company/language of the template is not set, the template is company/language neutral, i.e. valid for all companies/languages.

The Is default flag is applied to all templates with the same Template ID. This means that the default template is determined considering the Is default flag and the report run-time company (usually current company) and run-time language (usually current user language, or Customer/Vendor language).

After the template is assigned to the Purchase order report, print the report to Screen by clicking the Original preview button on the Purchase order confirmation form.

4. Add additional data to the report

Let’s say that we have to add some additional data to the report, for example data related a vendor with whom the printing purchase order is placed, e.g. vendor's VAT number.

4.1. Create the custom DSP class

In order to add additional data to a Docentric SSRS report, we need a custom DSP (Data Source Provider) class. So far, we have used the default (base) DSP class for Docentric SSRS reports, that automatically builds Data Source Package (DDSP file) for us, reusing the built-in RDP class and tables of a SSRS report.

Open the Reports form and click the Create data source provider class link button.

The Create SRS report artifacts form opens. After we enter the names of artifacts and click the Create report artifacts button, a temporary private project with the DSP class is created and this class is assigned as Data source provider class to the report.

Take a look at the created project and DSP class.

Open the class in the editor and implement the generateXmlDataSource() method so that the additional data (VendorVAT) is included. Learn how to add additional data to a SSRS report in detail >>

4.2. Regenerate the report Data Source Package

When the generateXmlDataSource() method of the DSP class is implemented, we need to regenerate the report Data Source Package (DDSP file). We can do this in the same way we did it initially. Navigate to Company/Procurement and sourcing/Common/Purchase orders, open the Purchase orders list page and click the Purchase order confirmations button in the Journals button group on the Purchase action pane. Click the Use print management button on the Purchase order confirmations form.

When the generateXmlDataSource() method of the DSP class is implemented, we need to regenerate the report Data Source Package (DDSP file). We can do this in the same way we did it initially. Navigate to Company/Procurement and sourcing/Common/Purchase orders, open the Purchase orders list page and click the Purchase order confirmations button in the Journals button group on the Purchase action pane. Click the Use print management button on the Purchase order confirmations form.

4.3. Update the template

Always when the report data source is changed we need to update the report template with the new DDSP file in order to refresh the template data source.

If we change a data source, e.g. add some new fields or records, update of the template data source WILL NOT OCCUR automatically. In order to refresh it, we must reload the updated DDSP file by clicking the Load Data Source button from the Docentric AX Add-In ribbon.

We can open the template directly from the template location (file system or SharePoint) or by clicking the Design button on the Report templates action pane.

After the template document has opened, navigate to the Docentric AX ribbon and click the Load Data Source button. Notice that the current template data source schema does not contain the new VendorVAT data field.

After the new DDSP file is loaded, we can see that the new VendorVAT data field appears in the template data source schema. Next, if you click on the View sample data button (marked on the piture below), XML Editor opens with the template sample data loaded.

Finally, we will design the template. In order to do that please follow this step by step tutorial.

The finished template looks like this.

Now let’s see how the template works. Navigate to Company/Procurement and sourcing/Common/Purchase orders, open the Purchase orders list page and click the Purchase order confirmations button in the Journals button group on the Purchase action pane. Click the Original preview button on the Purchase order confirmations form.

The Purchase order report is printed to screen.

Notice that all the number and date formats in the generated report are formatted using English USA culture. This is because the language of the selected vendor (i.e. purchase order) is set to en-us.

Report previewing during template design uses formatting from the Windows regional settings on the user’s AX client computer whereas the reports generated from the AX client have formatting controlled through the AX user’s setup in the Options section, or, in some cases depends on the language of a vendor/customer.

Resources

Data source provider class Data source (DDSP file) Report Template

See also

How to Use Labels with Reports >>
How to Add Additional Data to a Report >>
How to Use a Built-in SSRS report as Docentric Report >>
Report Setup in Detail >>
Download SSRS Report Examples >>
How to Design Templates with Docentric AX Template Designer >>
Explore Improved Report Print Destinations >>
How to Write a Data Source Provider Class >>

IN THIS ARTICLE