Offline, preview and debug reports in Microsoft Dynamics NAV 2013

In NAV 2009 it is pretty much a black box what exactly the Report Viewer 2008 is rendering. Yes we can see the dataset in “About this Report”, but the final dataset actually being rendered in Report Viewer 2008 is not possible for us to see. Well all this will change in Dynamics NAV 2013. In the same “About this report” window in NAV 2013 the Reporting team has added a small button called ““Export As XML”. This feature is well hidden in NAV 2013 but I’m sure this feature will be one of your favorite features if you are developing reports. At least for now this feature is one of my favorites. Let me give you an example.

Let us imagine that I have an issue with the layout in report “5872 – BOM Cost Share Distribution” that I cannot solve. I know I have great colleague which is an expert in SSRS reports, and I’m sure that he will be able solve my issue. But he does not have NAV 2013 so sharing the NAV objects or the whole database is not an option. Also my expert could be working at an external company, so sharing all objects related to report 5872 is not preferred, or my expert friend could be somebody I don’t know in the Mibuso forum helping me out. In NAV 2013 I only need to share 2 files with my expert friend, for him to be able help me with the layout issue I have in report 5878. Note: I have no issue with report 5878, just think it looks great with all the new SSRS features it is using.

So how do I share these 2 files, and how does my expert friend get to run the report without having NAV 2013 installed?

First file, the Report.rdlc:

Open report 5878 in Object Designer
Hit “View / Layout”
In Visual Studio select “File / Save Report.rdlc as…”
Save the “Report.rdlc” to i.e C:tempOfflineReport

Second file, the Dataset.xml:
Open report 5878 in Object Designer
Hit CTRL+R (Yes we can now run RDLC reports from Object Designer)
On Request Page hit “CTRL+ALT+F1”(I do this on Request Page to enable the possibility to see the dataset of the Report without having to run it again. NAV uses more memory when running reports and this is enabled, so remember to restart the RTC client when you are done)
Close the “About this Page” window
Hit “Preview”, report 5872 is displayed
Now hit “CTRL+ALT+F1” once again, this opens the “About this Report” page.
Hit the “Export As XML” button and save the “dataset.xml” to i.e C:tempOfflineReport

Now you have your 2 files you can share with your expert friend, but how does he manage to run and design your report? Well you can ask him to create a Visual Studio project as explained here in the Online Help Help: “Development / Objects / Reports / Designing, Running and Printing Reports / Report Design: Walkthroughs / Walkthrough: Running a Report Offline” or you can just use the OfflineReport project I have shared here: http://sdrv.ms/MrxhON

All you expert friend needs to do now, is to replace the “report.rdlc” and “dataset.xml” in the OfflineReport project, with the 2 files you have provide him with. When he has completed this task he opens the solution:

image

He realizes the issue, fixes the issue and to make sure the that his fix is actuating working he previews the report, by hitting CTRL+F5(I wish this was possible when opening Visual Studio from Object Designer):

image

He then returns the fixed “report.rdlc” to you and you open the file in notepad, copy all. Open report 5872 in Object Designer, Hit “View / Layout”. Right click Report.rdlc and open in XML editor. Select All, and paste in the changes from you expert friend. Build, Compile and run the report. You see that your report now works and you send a big thank you to your expert friend.

So without having access to either your NAV objects and NAV 2013, your friend was able to fix your report layout issue.
I think this is super cool and I can’t wait for you guys to actually start using this in Mibuso forum. One BIG WARNING though, you are sharing real data in the dataset,xml, so before posting your dataset.xml you might want to change some names and numbers in the dataset.xml file.

Another big advantage with the possibility to “Export as XML” is that it is now possible for us to see what exactly the Report Viewer is rendering, and with this information you can, in many cases, debug why your report does behave as expected. But of course you can as have a look at report to see if you can optimized it, you might sending over the same thing many times, and having a look at the dataset.xml can easily reveal this information to you.

At last, you will need Visual Studio 2010 Pro to be able to open the OfflineReport project. The free version, as I explained here, seems not to work, or I’m not smart enough to get it to work. So if anybody can get it working with the free version of Visual Studio let me know.

Thanks, Claus Lundstrøm, Abakion.com