Quantcast
Channel: AX2012 – Everything Dynamics BI |
Viewing all articles
Browse latest Browse all 5

Building SSRS reports in AX2012 (Query and RDP) – Part 1

$
0
0

This post will take on query based reporting in Dynamics AX 2012.

First off, lets start by creating a simple query. I will only add the “ProjTable” to my query for now:

1

Set the Fields property “Dynamic” to “Yes”. This will return all the fields on that table and will make maintenance easier because you don’t need to change the query if a field is changed in the underlying data source. If set to “No”, you can restrict the fields returned by the query. This is better for performance because unused data is not returned to the client each time the query is run.

2

Then open up Visual Studio, go to File -> New -> Project

3

This will give us some different options. Head over to the Microsoft Dynamics AX Template and choose Report Model. This is the AX Model for creating SSRS reports. Give it a fitting name and click “OK”.

4

Now you have a box fresh solution and we can now go ahead adding elements to this. Right click the Report Model and select “Add” then “Report”. Give it a name and save. Now we have a report object in our solution.

5

Notice that the icon for the Report Model is the same as when we were selecting it from the New Project screen. This means that it hasn’t been added to the AOT yet. This is not something that is happening automatically. We have to make Visual Studio upload the solution into the AOT in AX.

6

Again right click the Report Model node and go to “Add <solution name> to AOT”:

7

So, now we are going to add a dataset to our report. So double click the report node in the solution explorer and go to the Datasets node inside the report. Right click and choose to add a new dataset. (Here we can also select RDP (Report Data Provider) as a data source type. We will have a look at this type of data structure in my next blog post.) Then go into the “Query” property at the properties pane and click the ellipsis button.

8

This will give you a list of all the queries storied in the AOT. Select the query you created and hit next.

9

In my example I added the ProjTable into the query in AX. Select the fields you want by expanding the All Fields node or just select all and click OK. Notice that there are also some display methods in here which holds other kind of data:

10

Now we have our dataset. So now we wanna go ahead and create our report. Select the dataset you just created and drag and release it over the Designs node. This will automatically create a Auto Design report containing all the fields you got in your dataset:

11

I have pretty many fields in my dataset at the moment so I’m gonna go and narrow the fields down to the three fields as show in the screenshot below. Just select all the fields you want to remove and press delete.

15

So now I have a report containing three columns, but I want to add some simple layout style to it. First select your Auto Design node then head over to the properties and look for “LayoutTemplate”. This will give you different templates to choose from. In my example i went for the “ReportLayoutStyleTemplate”:

12

Then select the DatasetTable inside your Auto Design and choose a Style Template:

13

Now we are ready to run our report! Right click the Auto Design node and select “Preview”. First we will be prompted asking to insert a value into the parameters (depending on the dataset and the tables you added to your query). Hit Select and input a value into the parameter (I’m just gonna input a * into the ProjId parameter. This will give me all the projects) and press OK:

17

Then press the “Report” tab and the report will render!

 

16

 

The last thing we wanna do is deploy the report to AX. Right-click the project node inside the Solution Explorer and select “Deploy”. Visual Studio will then deploy the SSRS report to the report server:

18

 

This is the simplest way to create a Query based SSRS report for Dynamics AX2012. In Part 2 I will cover how to create a RDP based report.

Good luck!

 


Viewing all articles
Browse latest Browse all 5

Trending Articles