Basic Report Examples

Example 1

Report ID PrintSalesOrder
Description Print a selected sales order.
Demonstrates

This is the simplest example you can to start with. It shows:

  • How to add a report parameter
  • How to validate report parameters
  • How to write a simple DSP (Data Source Provider) class

In the Walkthrough for this example you can learn how to develop, update and test Basic reports step by step. You can test/run this report by opening the report menu item.

AX Basic Report Artifacts
Design Template Step by Step Tutorial Explore Template Examples Step by Step tutorials.
Setup Screenshots
AX artifacts
DDSP file
Template document
Download resources
Read instructions >>

Example 2

Report ID PrintPurchOrder
Description Print a purchase order from the Purchase orders list page.
Demonstrates
  • How to create a plain Docentric Basic report
  • How to run a report in the context of an underlying entity
  • How to run a Docentric Basic report from code
  • How to send a report to multiple print destinations

NOTE: See the similar example Walkthrough here. You can test/run this report only in the context of the Purchase Orders list page.

AX Basic Report Artifacts

Joint project for PrintPurchOrder and PrintPurchOrderList reports.

Design Template Step by Step Tutorial See the tutorial:
Example 5: Purchase Order Report
Setup Screenshots
AX artifacts
DDSP file
Template document
Download resources
Read instructions >>

Example 3

Report ID PrintPurchOrderList
Description Print a list of purchase orders selected using report parameters.
Demonstrates
  • How to create a complex report dialog form
  • How to use different hooks in report execution to inject custom business logic
  • How to dynamically change Print Report Settings and Print Destination Settings
  • How to use placeholders in Print Destination Settings
  • How to use the Group tagging element when designing templates

NOTE: See the similar example Walkthrough here. You can test/run the report by opening the report menu item.

AX Basic Report Artifacts

Joint project for PrintPurchOrder and PrintPurchOrderList reports.

Design Template Step by Step Tutorial Explore Template Examples Step by Step tutorials.
Setup Screenshots
AX artifacts
DDSP file
Template document
Download resources
Read instructions >>

Instructions

In order to run an example, please do the following:

1. Make sure that you have installed Docentric AX Framework.
2. Import provided AX artifacts related to the example.

To test the PrintPurchOrder report you will have to import the modified Purchase Orders list page as shown on the pictures below. This is needed to demonstrate how to run a report in the context of an underlying entity, more precisely the PurchTable table. In other words, you can test/run this report only through the corresponding menu items placed on the Purchase Orders list page with Data Source set to PurchaseTable.
All other reports you can test/run simply by opening the report menu item.

3. Navigate to the Company/System administration/Area page/Setup/Docentric AX/Reporting menu and open the Reports form.

You can proceed to the next 4. – 6. steps, or you can use the Import functionality to import the report meta data (the provided XML file) that can be found in the downloaded example resources.

4. Create a new Docentric Basic report by clicking the New Basic report button, selecting Print report class and Data source provider class that the example refers to. Report ID is automatically set by selecting Print report class.

5. You can decide to use a different Template storage type than the one used in the example (you can see this on the Setup Screenshots). In case you select File system as Template storage type copy the corresponding template(s) to a folder which is a subfolder of Default file system storage. For the test purposes you can use any folder on a local disk. In case you choose SharePoint as Template storage type upload the corresponding template(s) to the SharePoint library which is set as the Default SharePoint storage (or to any other).

Templates for Docentric reports can be stored on the file system (e.g. shared folders/network drives) or on a SharePoint document library. Ensure that AOS has READ access to these locations.
Also, if you want to enable end users to design the templates directly on their file location, you need to ensure that end users have WRITE access to the templates as well.
The default report template storage location can be set in the Company/System administration/Setup/Docentric AX/Reporting -> Reporting parameters form.

6. Add the template(s) to the report by clicking the Add button on the Reports form and select the template document on the Report template form. Afterwards, revalidate the report by clicking the Validate button.

7. Run/test the report by opening the corresponding menu item. You can do this by selecting the menu item and click CTRL+O. Only in case of the PrintPurchOrder report you have to run/test it from the menu item(s) placed on the Purchase Orders list page, i.e. Data source of the report menu item should be set to the PurchTable table.

The DDSP file – report data source package file – is provided in case you want to make a template for the report from scratch. Actually, the design process of a report template can be a completely separated task performed only by using MS Word with Docentric AX Template Designer installed (Add-In for MS Word) and the report DDSP file.

Nevertheless, once you registered the report with Docentric Report Setup, you can generate a new DDSP file with the different report sample data and preview languages.

Don’t forget to set up the print archive for Docentric Reports in order to test report archiving.

8. To set up document types for archiving or attaching Docentric reports, click the Document types for archiving reports menu item.

9. Set up the DocReport and DocFile document types in a regular way, e.g. as you would manage the built-in SRSReport or File document type.

There are two archiving document types that apply to both Docentric SSRS and Basic reports: DOCFile and DOCReport. DOCFile is a Document type responsible for attaching report output files to an underlying entity, in case that File has been selected as a print destination with the Save to attachments flag set to true. DOCReport is a Document type responsible for archiving reports, i.e. for saving reports to Print archive.

By default, DOCFile is self-created by cloning the File built-in document type whereas DocReport is copied from SRSReport, a document type responsible for archiving built-in SSRS reports.

You can also follow step-by-step tutorials from Docentric Basic Reports chapter to build an example on your own, using the examples given here as a reference.

See also

SSRS Report Examples >>
Document Template Library Examples >>
How to design templates with Docentric AX Template Designer >>
How to Write a Data Source Provider Class >>

IN THIS ARTICLE