This is follow-up to post from a few days ago (Dynamics AX 2009: SSRS Reports and the role of Business Logic & Data Methods). In the last post, we created a very basic report using DataMethods.

Some things to note about that report

  • There are two kinds of report designs: “Auto Designs” and “Precision Designs”
  • The report we created was an “Auto Design” which for standard “list & charts of data” reports is the fastest way to get an SSRS report in Dynamics AX

Now let’s take a look at the way the report looked by looking at the preview

 

image

 

image

 

And remember that the reason that it looks unimpressive right now is that there are no layout and style templates attached.

BACKGROUND ON AUTO DESIGN TEMPLATES

Templates control how Auto design reports look and how they are arranged on the page.

Their intended use of these templates is reports can share the same templates – thus you can keep all your autodesign reports looking consistent.

 

FIND THE PRE-BUILT TEMPLATES

Let’s make these reports look better. Dynamics AX comes with some pre-built templates so we’ll start by using them.

First we need to “get” them by walkthrough these steps (http://msdn.microsoft.com/en-us/library/cc576854.aspx) …

 

Select File > Add > Existing Project from Dynamics AX

image

The Add Existing Project from Dynamcis AX dialog will appear

 

image

In this list select “SharedLibrary” and click OK

image

And then you’ll see a new project in the solution

 

image

A close-up view …

image

USING THE PRE-BUILT TEMPLATES

In the report project, right-click on  DemoDataMehod1 > References and select Add Reference.

NOTE: do NOT add this reference to the DemoDataMehod1 > BusinessLogic > References node – the reference can be added but you won’t be able to select it in the report design.

image

image

 

The Add Reference dialog will appear (this is slightly different from the normal Visual Studio Add reference dialog)

 

image

 

Select “SharedLibrary”

image

click Add

image

“SharedLibrary” now appears in the list at the bottom.Click OK

image

 

And you can now see the reference has been added

image

Select Model View to get back to the report model

image

You can see that “Shared Library” is in the model also

 

A close-up view …

 

image

 

Now click on the report design 

image

And in the properties window you’ll see LayoutTemplate – we’ll associate this with one of the templates in SharedLibrary

image

Click the field to see the possible choices

 

image

Pick “ReportLayoutStyleTemplate”

 

image

Now select the Table

image

And look at its properties

image

Click on Style Template and select “TableStyleTemplate”

image

Now we’ve associated a layout style the entire report and a style for the table. Let’s preview.

image

image

image

As you can see the report looks much better.

 

BEFORE VERSUS AFTER

Just so that it’s totally clear, let’s put the original report we started with next to the how it appears now.

image

image

  • The fonts have changed
  • There is a header for the report
    • the name of the report design is seen as the title of the report.
    • The company name is present
    • There’s info on the page number and when the report was generated
    • A horizontal line separates the header from the body of the report

 

 

 

 

WHAT KINDS OF TEMPLATES EXIST?

The simplest way to see them is to try to add one.

Right-click on the report project and select Add > New Item

image

A dialog will appear

image

Looking into it you’ll see several kinds of items

 

image

And of these you’ll see six kinds of templates

image

 

 

 

A FEW MORE TWEAKS

Now that we see that the design name is being used, let’s give it a better name.

We could try to rename the AutoDesign1 node to something else – but this is an “identifier” in the code so we can’t put in a string with spaces.

So instead of renaming the Design, we’ll change it’s properties

Right click on the design and select Properties

image

And in the properties window we’ll change the Title to something descriptive

image

Enter “Names and Ages”

image

And you’ll see that the preview reflects this change

 

image

We are still left with “Dataset1” as the name of the table, by setting the properties in this report element we can fix that also

 

image

image

image

Which gives us this in the preview …

image