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:

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:


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):


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,

You found me

When I started my new blog a few days ago, I was concerned that you guys would not be able find my blog. There are so many NAV blogs out there and finding them all can be challenging. But in 3 days with my first blog post live I can conclude that you did not have any problems finding little me Smile

I’m a sharing guy so let me share the number of hits I got so far. In the 3 days the blog has been live, I now have a little under 5000 hits. This is actually more hits that I used to get in 3 days when blogging on the NAV team blog, so I’m happy and will continue blogging. Thanks guys!!!

Although you might want to follow my blog on Mibuso I suggest you subscribe to the “ Master Site Feed” found here:  
This way you can subscribe to all bloggers on Mibuso and don’t have spend time find new post for all the blogs. Many of you are probably already doing this, but just wanted to give you this little tip.

Also from the blog post stats, I can conclude that none of you are using Bing. Being at Microsoft for 13 years I might have be brainwashed, but I’m only using Bing as my search engine. I rarely use Google, and when I do I realize that what I could not find on Bing, I could not find on Google either. So to me the search engines are pretty much the same, or am I missing out? Bing has an awesome new picture everyday to look at, instead of the letters in Google created in different shapes depending of day of your search.

Maybe you should give another chance?  

Thanks, Claus Lundstrøm,