Welcome to MSDN Blogs Sign in | Join | Help

Dynamics AX 2009: Creating a simple SSRS Report

Dynamics AX 2009 features support for writing reports using SQL Server Reporting Services. In this post, I’m going to show you how to create a simple SSRS report that accesses data in the AX database.

The overall process I will describe will focus on the first stage of authoring and deploying the report from the developers perspective.

In future posts I’ll cover

  • Formatting the report
  • Adding menu items to launch the report
  • Security
  • Accessing OLAP data
  • etc.

The basic steps

  • Create an AX Query
  • Create a new AX Reports Project and a new report in that project
  • Create a dataset in the report bound to that query
  • Create a design to report to render the dataset
  • Preview the design
  • Deploy the design to SSRS
  • View the report via IE
  • Save the Report project back into AX

The report I will create will be a simple unformatted table of customers and customer IDs.

 

Create an AX Query

Launch the Dynamics Client

image

Open the AOT

image

image

In the AOT, right click on Queries and select New Query

image

By default a new query will be create with a default name (in this case “Query1”)

image

Right-Click on that query and select Rename

Give it the name “DemoQueryCustomers” and hit RETURN

image

image

Expand that query in the AOT

image

Right-click on Data Sources and click New Data Source

A new data source will be created and by default attached to some table (in this case it will be called “Address_1”

image

image

If you hover over this datasource you will see the query string

image

Right click on that data source and select Properties

image

The property window for that data source will appear

image

Navigate to the Table property and change it to the “CustTable”

image

Click on the Name property

You’ll notice that the Name changes to “Cust_Table_1”

image

Close the property window

image

image

Click Save All in the AOT

image

Close the AOT

image

image

Create a new AX Reports Project and a new report in that project

 

Launch Visual Studio 2008

image

File > New > Project

image

The New Project dialog will launch

Under Project Types, select Visual C#  / Dynamics

Under Templates select Dynamics AX Reporting Project

Change the Name to “DemoReportsLibrary1”

Click OK

image

An new AX Report Library project is created

By default it contains a report called “Report1”

Right click on this report and rename it to “DemoReportCustomers”

image

Create a dataset in the report that is bound to the AX query

In the report, right click on Datasets and select new Dataset

By default the name of the Dataset is “Dataset1".

Rename it to “DataSetCustomers”

image

In the properties window for the Dataset

Verify that the Data Source is “Dynamics AX”

Verify that the Data Source Type is “Query”

Verify that the Default Layout is “Table”

Click on the Query field

image

Click on the ellipsis button in the value for the Query field

image

A dialog will launch that will list all the queries in AX. It will take a few seconds to populate this dialog with all the queries so be patient.

image

Under Select Query, choose the query you previously created “DemoQueryCustomers”

After you select that query the right column will be filled with fields from the query.

By default All will be selected.

Uncheck All

image

Check the AccountNum field

image

Check the City field

image

Check the Name field

image

Check the State field

image

Click OK to close the dialog

You’ll now see that ”DataSetCustomers” contains all the fields you selected.

image

Select “DataSetCustomers” and drag it into the “Designs” node

image

After you finish dragging, you’ll see that a design has been created. It will be given the name “AutoDesign1”

image

Preview the design

With AutoDesign1 selected, click Preview in the toolbar

image

 image

You’ll notice a message at the top of the preview saying “The design has validation warnings” and you can see the warnings in the error list at the bottom.

We’ll ignore this for now.

Click the Save icon to save the report

 

Deploy the design to SSRS

Right click on the solution and select Deploy

image

At the status bar in the bottom you’ll see a message on the left and some animation on the right indicating that the deployment is in progress.

image

Eventually it will say “Deployment succeeded” in the status bar

image

View the report via IE

Launch IE and navigate to your SSRS reports server (in this example it is http://isotopex1:81/reports/)

image

Navigate into the Dynamics link

image

Find the report we deployed

It will be listed as “DemoReportsLibrary.DemoReportCustomers.AutoDesign1”

Click on it to view the report

image

And now you’ll see the report

image

 

Save the Report project back into AX

Close IE

In the solution, right click the report project (not the solution) and select Save to AOD

image

Open the Dynamics AX client

Open the AOT

image

In the AOT expand the Report Libraries node

you’ll see the report library “DemoReportsLibrary” is now in AX

if you need to edit the report library again just locate it in the AOT, right-click it and select Edit in Visual Studio

image

Published Friday, October 24, 2008 9:40 PM by saveenr

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Dynamics AX 2009: Launching an SSRS report from the Dynamics AX client UI

In my previous post I showed how to create and deploy report. At that time I just manually browsed the

Sunday, October 26, 2008 2:37 PM by Saveen Reddy's blog

# re: Dynamics AX 2009: Creating a simple SSRS Report

Thanks for this post - it is very helpful even though life is not often like 'the example'. I depend upon resources like yours. We are implementing an AX2009 solution presently and there are reports requiring some complex SQL queries that we will have to write soon. How flexible is using the AX data source with complex SQL? From a security perspective it seems simpler to delegate this to AX rather than create a custom security layer somehow. But our first priority is getting the reports the users want and the SQL won't be trivial. Do you have any advice?

Monday, October 27, 2008 6:38 AM by Mike

# re: Dynamics AX 2009: Creating a simple SSRS Report

SSRS Reporting in Ax supports using external SQL stored procedures as a datasource.  This might help with building complex SQL, and also may help in setting up security.

Tuesday, October 28, 2008 9:55 PM by igor

# re: Dynamics AX 2009: Creating a simple SSRS Report

Security from the AOT? Not using an external data source I assume? MSDN recommend AOT security but this appears to be inflexible for reports driven by complex SQL.

My assertion is: as soon as you have 1 report which requires a complex SQL then you have to write a separate security system (if a security policy is required). Can anyone help clarify?

Wednesday, October 29, 2008 4:53 PM by Mike

# re: Dynamics AX 2009: Creating a simple SSRS Report

Can you use Visual Studio on a client machine in order to create new reports. I can't seem to find the add-in for Visual Studio in order to create a Dynamics Template.

Wednesday, November 12, 2008 3:22 PM by Mark

# re: Dynamics AX 2009: Creating a simple SSRS Report

It's part of the install for Dynamics AX 2009 and requires you to have VS 2008. Hope that helps.

Thursday, November 13, 2008 4:33 AM by Mike

# re: Dynamics AX 2009: Creating a simple SSRS Report

We're trying to secure SQL-driven reports and pass in Windows Login ID as a parameter so that we can return records they are authorized to view.

User.UserID is evaluated when placed in a text box on the report but we need to know this information earlier when parameters are passed in.

We've tried following advice at http://forums.whirlpool.net.au/forum-replies-archive.cfm/1076984.html but this is SSRS2005 specific. Even though the same options are available in VS2008 AX Reporting Projects, the User.UserID expression is passed to the SQL as a string without being evaluated.

We are at a dead-end to secure SQL-driven reports in AX2009/SSRS environment.

Wednesday, January 07, 2009 7:20 AM by Mike

# re: Dynamics AX 2009: Creating a simple SSRS Report

How do I create a report with a parameter? Let's say I want to return data for only InvoiceNo "12345". It seems in AX there is no way to create a parameter in the Query in the AOT. I can create the parameter in SSRS but it doesn't seem to limit the data returned from AX and there seems to be no way to link them.

Monday, January 12, 2009 4:46 PM by Mark

# re: Dynamics AX 2009: Creating a simple SSRS Report

This post is very helpful for me as we are going to use SSRS reports in our project.

Thanks a lot

Friday, January 23, 2009 1:55 AM by Mukesh Soni

# Step-by-Step Approcah on Creating SSRS Report

Here are some great blog posts by Saveen, on creating SSRS Reports and consuming cubes. Thanks for putting

Wednesday, May 20, 2009 10:40 PM by Dilip's blog on DYNAMICS AX

# re: Dynamics AX 2009: Creating a simple SSRS Report

I'd like to hear real-world experiences from people using SSRS - My initial impression is that when taking into consideration the fact you can't utilize Ax business logic easily, and that you lose the procedural approach to pulling data together, it is by far preferable at this stage to stick with Ax reporting. Correct me if I'm wrong but the only reason people seem to be focusing on SSRS is because of the marketing push from MS. Formatting and delivery options are better in SSRS to be fair, but anything more than trivial reports seems to be prohibitively time-consuming to develop. Can anyone give me specific functional or technical reasons to use SSRS over internal reporting tools (considering only the current versions of Ax and not the sales-based 'road map').

Wednesday, September 16, 2009 11:22 AM by Dan

# re: Dynamics AX 2009: Creating a simple SSRS Report

I wasn't able to deploy because I cannot install AX Reporting extensions. When trying to install the prerequisites on a windows xp machine, it keep on failing.

Any ideas?

Wednesday, October 21, 2009 2:37 PM by Milton

# re: Dynamics AX 2009: Creating a simple SSRS Report

Does anyone know how to insert a newly crated report in Reporting Servies to the Role Center? When I ad web part 'Dynamics Report Server Report' to the role center and try to choose the report it is not available on the report's list. What should be done to make it available there?

Thanks.

valdemar

Tuesday, November 03, 2009 8:02 AM by valdemar

# re: Dynamics AX 2009: Creating a simple SSRS Report

I Can't get the Microsoft Dynamics AX Reprting Tools on the internet ....

Where Can I Download this tool..????

Please help me for this tool...

Thanks in advance ....

Regards,

Janak Talekar

janak.talekar@hotmail.com

Friday, November 06, 2009 3:49 AM by janak

# re: Dynamics AX 2009: Creating a simple SSRS Report

@janak

The Reporting tools are not distributed separately from the rest of Dynamics AX 2009. There is no specific web download for those tools. In order to get the tools, you must have the Dynamics AX 2009 DVD and install the reporting tools from the setup program.

Friday, November 06, 2009 9:14 PM by saveenr

# re: Dynamics AX 2009: Creating a simple SSRS Report

Any idea or thoughts on how the SSRS works with the concept of shared tables (using virtual company) and multiple physical companies in Dynamics AX. Any reference document would be of great help. Thanks.

Friday, November 13, 2009 6:06 AM by Manish Wadhwa

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker