Sunday, December 8, 2013

Faster SSRS Reports Development

Dynamics AX SSRS Reports Development using Report Builder & VS

I am a personal fan of Report Builder with its capabilities of allowing users or [Developers] to quickly create and modify reports. 

When developing or modifying Dynamics AX Model Reports using Visual Studio I always feel its kind of slow when compared to Report builder. [In AX 2012 Visual Studio is the defacto for SSRS development.]

Why VS is slow when deploying reports ? 
It primarily does a lot of things like validation of the existing reports with the modified ones, then deploying all the localized reports (even when you don't want it to) and finally generating the model files for AOT deployment. 

In Report builder if you want to change a field or expression or layout it takes a minute to change it and preview it from Report viewer or AX which is fast in every sense [without having to wait for 5 minutes]. 

This post focusses on how to make the best use of Report builder and then using VS to deploy it. 

Lets take an example of doing some UI changes like adding 

  • adding new fields
  • adding expressions to these fields 
  • doing some layout changes and styling your report 

Step 1. Do all these changes in Report builder. Once done download the RDL file and open in notepad.

Step 2. Go to VS, open the same Report and edit using the built in designer. Right click the designer tab and click 'Open containing folder'. This would provide the location of the RDLC file which would be in a temporary folder. 

Note: Now don't worry about the file extensions for now.

Step 3: Open the RDLC file in another notepad. 

Step 4: Now focus on the Body and Page elements which primarily contains your layout, field properties and so on. So just copy the Body element and replace it in the RDLC file. 

This is the High level blocks of a RDL file [which is similar to RDLC] 


         [All your layout (Tablix,etc) and design (Groups, expressions, etc) elements are here]
        [Header report items here]
        [Footer report items here]
       [Do not modify this section as this differs between the tools] 
      [self explanatory]  
   <Code />

Note: If you have done changes in the Page header or footer then just copy and replace them as well. 

Step 5 :You are almost there. Now deploy the Report from VS and you should have the latest changes deployed to AOT and SSRS. 

Note: After you deploying your changes, all matching SSRS reports would be overwritten. [Meaning the current report you are editing in Report builder would be changed] This is not a problem because now your VS has the latest changes

This would allow you to develop SSRS reports quickly in Report builder and then finally deploy them to AOT. 

Limitations in Report Builder
Cannot connect to AX datasources, only VS can do it. So any Model changes like adding new fields, changing field properties, adding new datasets do it in VS. 

Works In
Visual Studio 2010 [2012],  SQL Sever 2008 [2012], AX 2012 [2009]
;square brackets mean not checked but would work

No comments:

Post a Comment