Attach a Report as PDF in e-mail

It has been a while since I blogged about how to do attach a report as PDF in e-mail here: http://blogs.msdn.com/b/nav/archive/2009/10/08/send-email-with-pdf-attachment-in-nav-2009.aspx

image

image

The files found at the NAV Team blog is a bit old now, and I have made a newer version which does not required you to hard code the computer name.

The new NAV 2009 version is found here on my SkyDrive:http://sdrv.ms/1aeGiTr

and then I just upgraded this for NAV 2013 as well: http://sdrv.ms/10oT3Kd 

Feel free to copy the code.

You might also note that I have a lot of other examples at my Public folder at SkyDrive. Feel free to explore and steal any examples I have placed there, direct link to My Public folder is http://sdrv.ms/ZDdFtn Smile

When I started adding examples in my Public Folder, only NAV 2009 existed, so I did not think of creating a NAV 2009 folder. So all examples in the root is for NAV 2009. Now I don’t want to move them since I will brake any links to these files.
I will make you guess what report examples can be found in the NAV 2013 folder Smile

Again feel free to copy any of my examples, if you find them usefull of course.

/Thanks, Claus Lundstrøm, Abakion.com & Supplychainshop.com

How to Shut down and Restart Windows 8 using only the keyboard

I know this tip is not Dynamics NAV related but ever since I upgraded to Windows 8, the only thing that has really been a pain for me, is that I could not Shut Down the computer without using the mouse. Finally I found the solution, so here it is:

Press WINDOWS+M and then press ATL+F4

You will then get this option:

image

This works both from within Metro UI and normal Desktop.

Finally I’m happy with Windows 8 and it has been a puzzle to me why the Power Button is so well hidden in Windows 8, but just like RDLC reports things are easy to do when you know which buttons to press. Maybe the engineers building Report Designer in Visual Studio are the designers behind the Power Button in Windows 8 as well. I would not be surprised if that was the case Smile

BTW, If you are using Remote Desktop to Windows Server 2012, the same above options work and you get this this option:

image

Here you even have the option to uncheck “Planned” if you did not plan to close down the computer SmileAnd you need to write a comment why you are shutting down the computer before the “OK” button is available. We have support for 511 characters in this textbox, so don’t be shy explaining why you want to shut down the computer.

/Thanks, Claus Lundstrøm, Abakion.com & Supplychainshop.com

Working with images in RDLC reports

Working with images in RDLC reports and Visual Studio 2010 in NAV 2013 are unfortunately not done without doing some workarounds.

In this blog I will address 2 issues with images in RDLC reports:

  1. Images with transparent background will not show correctly when opened in PDF.
  2. Images will show unexpected lines at the edges of the image when printed.

Let us start with Transparent background issue:

Several times I have received company logos which transparent background in PNG format. The logos look great in the RDLC report when printed, and viewed in either Print layout or Print Preview, but when saved to PDF the image looks compressed when opening report in Acrobat Reader, i.e. version 11. Funny enough this is only when viewing the PDF file. When printing to paper from Acrobat Reader the image looks great.
But usually when printing to PDF we don’t plan on doing printing to paper, so we of course want the image to look great in Acrobat Reader as well. Here is a screen dump from Acrobat Reader of an image in PNG format with transparent background and an image in JPG format with no transparent background. Maximize the picture here, then it easy for you to see the difference.

image

Here is the workaround for getting the image to look nice in Acrobat Reader:

1. Open image with transparent background in Paint

2. Save the image in JPG format.

3. Accept that transparent background will be removed

image

4. Import image into report again and print to PDF. Issue is then solved. This of course does not work if you are required to have the transparent background in your report.

Note that PDF viewer in Windows 8 does not have this issue, so this seems like a Acrobat Reader issue.

 

Next issue; Unexpected lines showing at the edges of the image when viewing the report in Print Layout and when printing from either Print Preview or Print layout in Report Viewer.
When viewing the report in Print Preview and when printing to PDF this issue is not seen. But if you print to directly from Report Viewer images will have extra lines at the edges of the image:

Here is a screen dump from Report Viewer in Print Layout mode, and how it will look at paper when printed. It seems like start of the A in Abakion is printed in the end of the picture and the top of the head of the guy in the logo is printed under his right foot. This is clearly a bug in Report Viewer 2010. This bug is not solved in Report Viewer 2012, so I guess it is time to request a hotfix for Report Viewer 2010 and Report Viewer 2012.

image

Here is the workaround for getting the image to look nice in Report Viewer:

1. We need to increase the canvas size of the image. Unfortunately no standard image tools can do this in Windows. But lucky one of the developers of Paint in Windows left Microsoft long time ago and created Paint.NET a great Image tool for us, and best thing is that it is free. Paint.NET can be downloaded here: http://www.getpaint.net/

2. Open Image in Paint.NET.

3. Select “Image / Canvas Size”

image

4. Increase Width and Height with 10 pixels

5. Make sure that Anchor is set to Middle. We want to have middle here because we want make a border outside the image of 10 pixels so edges of the real picture is not repeated on other edges of the image.

6. Save image and Import image into report again.

7. View report in Print Layout in Report Viewer and try to print report to real paper. As you can see issue is now solved.

image 

I hope this post was useful for you.

/Thanks, Claus Lundstrøm, Abakion.com & Supplychainshop.com

Reporting Training

Reporting training in Atlanta is being filled up rapidly, and only a few seats left.

Read more here:

http://mergetool.com/services/RDLCClassWithClausL.html

You even get my e-mail at this link :-), so if you are interested in Report training and cannot make it to Atlanta, you are welcome to write me an e-mail.

Stay tuned, I have 5 reporting tips and tricks on it’s way, celebrating that I’m now MVP for the product I love.

Thanks, Claus Lundstrøm, Abakion.com & Supplychainshop.com

MVP Achievement unlocked

Today I unlocked a new Achievement by becoming MVP for Microsoft Dynamics NAV.

photo

Being at Microsoft for many years I have always admired the Dynamics NAV MVP’s for their dedication and knowledge about the product, and their willingness to share and help others, so now I actually feel quite humble becoming a MVP myself. 

Microsoft_MVP_logo_2

Thanks, Claus Lundstrøm, Abakion.com & Supplychainshop.com

Ask the Experts: Reporting in Microsoft Dynamics NAV session at Convergence 2013

Convergence 2013 is now only 2 weeks away.

If you are going to Convergence and want to connect with me I will be hosting the 2 “Ask the Experts: Reporting in Microsoft Dynamics NAV”, sessions:

Tuesday, March 19th from 5:00 pm - 6:00 pm:
http://www.microsoft.com/dynamics/convergence/neworleans13/Session-Catalog.aspx?session=IDNAV04-R1

Wednesday, March 20th from 5:00 pm - 6:00 pm
http://www.microsoft.com/dynamics/convergence/neworleans13/Session-Catalog.aspx?session=IDNAV04-R2

Convergence

You also have the change to connect with the World Champion in Supply Chain Management, Sune Lohse also from Abakion and the master behind http://supplychainshop.com/

Sune will be hosting the 2  “Microsoft Dynamics NAV 2013: Supply Planning & Inventory Visualizations” sessions where he will go deep dive in NAV 2013 Supply Chain:

Wednesday, March 20th from 5:00 pm - 6:00 pm
http://www.microsoft.com/dynamics/convergence/neworleans13/Session-Catalog.aspx?session=CSNAV17-R1

Thursday, March 21st from 5:30 pm - 6:30 pm
http://www.microsoft.com/dynamics/convergence/neworleans13/Session-Catalog.aspx?session=CSNAV17-R2

Convergence2

Notice that you will have a tough choice on which session to go to at Wednesday, March 20th from 5:00 pm - 6:00 pm since Sune and I will speak at the same time.

I trust you make the right prioritization so you can attend both sessions. Smile

If you want to meet up with me or Sune at Convergence 2013 leave a comment or write me an e-mail. I’m not writing my e-mail here but it’s quite easy to guess when you know that I work for Abakion.com

See you there.

Thanks, Claus Lundstrøm, Abakion.com

NAV 2013 Report Design and report transformation

While many of us was at Directions in Phoenix, USA in October, my good former colleagues Torben Wind Meyhoff and Nickolay Belofastow did a NAV 2013 Report Presentation.

At Campus Days 2012 in Denmark many presentations are in Danish, but luckily for us Nickolay does not speak Danish, so the presentation is in English for all of us to understand.

The video has just been released and can found here:

http://channel9.msdn.com/Events/Microsoft-Campus-Days/Microsoft-Campus-Days-2012/NAV-2013-Report-Design-and-report-transformation

It is a pretty good presentation, but when Nickolay starts talking about exporting all objects to TXT and converting them to NAV 2013 format and then importing into NAV 2013 in TXT format, bear in mind that this can of course not be done for all objects in one go when we are only blessed with a Partner license.

But take a break and watch the presentation.

Thanks, Claus Lundstrøm, Abakion.com

How to gain access to a database you do not have access to

I know this subject has been addressed before on other blogs, but I like to have things I can just copy and paste, so this blog post is mainly for my self and other people as lazy as me Smile

I will address how to get access to both a NAV 2009 and a NAV 2013 database. Scenario is that you have received a SQL backup from a customer. You do not have access to the database and need to get access to the database from Role Tailored client(RTC).

Here is how you get access:

NAV 2013:

Before running below script you need two ID’s.

USERSID and WINDOWSSID

USERSID is new for NAV 2013. USERSID is generated when a user is created in RTC. But we do not have access to the database, so we need to create this ID manually and apply this to the database. In my example I have used  ‘586dd133-71e5-4cde-be08-625e7580e2a5′ as my USERID, but I could also have used  ‘586dd133-71e5-4cde-be08-538e7580e2a5′ or ‘586dd133-53e5-4cde-be08-538e7580e2a5′. If you follow this syntax you are good to go. And of course verify that the ID has not been used before in the 3 tables: User, User Property and Access Control.

WINDOWSSID we also had to use for NAV 2009 and you get by running this command in a Command Prompt, but you probably know this:

wmic useraccount get name,sid

If you are on a domain, this command will retrieve all ID’s from all your fellow employees on your domain, so this can take a while. So I usually just use this little GetSID tool to get my WINDOWSSID. You can download if from my SkyDrive here:

http://sdrv.ms/U7geW3

OK, so now you have both your USERSID and WINDOWSSID. It’s time to run the script, so you can gain access to the database from RTC.

All you need to do is to replace my details in BOLD with your details and run the script from inside ”SQL Server Management Studio”

USE [Demo Database NAV (7-0) Supply Chain Box]

DECLARE @USERSID uniqueidentifier, @WINDOWSSID nvarchar(119), @USERNAME nvarchar(50)

SET @USERNAME   = ‘ABAKION\CLAUSL

SET @USERSID    = ‘586dd133-71e5-4cde-be08-625e7580e2a5

SET @WINDOWSSID = ‘S-2-5-21-3479854292-2160187097-728769791-8173

INSERT INTO [dbo].[User]

([User Security ID],[User Name],[Full Name],[State],[Expiry Date],

           [Windows Security ID],[Change Password],[License Type])

VALUES

(@USERSID,@USERNAME,”,0,’1753-01-01 00:00:00.000′,@WINDOWSSID,0,0)

INSERT INTO [dbo].[User Property]

([User Security ID],[Password],[Name Identifier],[Authentication Key],[WebServices Key],[WebServices Key Expiry Date])

VALUES

(@USERSID,”,”,”,”,’1753-01-01 00:00:00.000′)

INSERT INTO [dbo].[Access Control]

([User Security ID],[Role ID],[Company Name])

VALUES

(@USERSID,’SUPER’,”)

GO

You know have access to the NAV 2013 database.

NAV 2009

For NAV 2009 is a bit more simple, here you just need to run following script from inside ”SQL Server Management Studio”. Again just replace my details mark with BOLD.

USE [Demo Database NAV (6-0) Supply Chain Box]

INSERT INTO [Windows Login] ([SID]) values (’S-2-5-21-3479854292-2160187097-728769791-8173‘);

INSERT INTO [Windows Access Control] ([Login SID],[Role ID],[Company Name])

values (’S-2-5-21-3479854292-2160187097-728769791-8173‘,’SUPER’,”);

GO

You know have access to the NAV 2009 database.

Happy copy and paste.

/Claus Lundstrøm

Simplifying Document reports in NAV 2013

The goal with this post is to show how NOT to use Code.GetData and Code.SetData in the one of the most common used Document report in NAV, our beloved 206 report. Code.GetData and Code.SetData is used in the header to of the report to keep field values in sync with current sales order currently being printed in the body. Just adding the field in the header will not keep this synchronization, unfortunately. Yes we can now add fields directly into the header in RDLC 2008, used in NAV 2013. Actually when I realized that this was possible in RDLC 2008, I was actually crying, because this limitation in RDLC 2005, used NAV 2009, has been a huge pain, at least for me.
But in I this example which I’m about to show you, I will not use this new capability in RDLC 2008.
This blog post is pretty long so I would like to show you the header in Report 206 before and after my changes. Looking at the before and after images should give you an idea what this post is all about.

Here is a screenshot of the header in standard report 206 in just released NAV 2013:

image
As you can see a lot of <<Expr>> all over and not really human readable, and it gets worse when opening one of these expression, because the values are just Code.GetData and a number.

And here is a screenshot of the header after my changes which I explained in details in this post:

image
As you can see now all fields are visible and if you need to make modification it easy to locate where your changes need to take place.

 
So here we are, NAV 2013 have just been released and standard report 206 is still using Code.GetData and Code.SetData, just like it did in NAV 2009. And they way it is designed it needs to use Code.GetData and Code.SetData. I will show you how you simple can change this so the report becomes human readable, because i.e. “Code.GetData(54,1)” in my eyes is not. 
For the people not familiar with Code.GetData and Code.SetData in RDLC reports I will do a small introduction now. If you already know how this works you can skip this section and go directly to the “Redesigning report 206.”, where I show you how to get rid of Code.GetData and Code.SetData in report 206.

Understanding Code.GetData and Code.SetData

To understand how Code.GetData and Code.SetData works there are 4 areas we need to look at. As I always I like to visualize things so if we look at the header and the top of the body of report 206 it looks like the below picture:

image

  1. Tabel with actual fields. Notice that there is only 1 textbox, in NAV 2009 we had 4 textboxes. The report developer probably thought adding 4 groups did not really simply things, so now we have all 54 fields added to one single textbox. That is a lot fields in one single textbox, good thing it is hidden and only use to get the values from current scope in the report dataset.
  2. So we have now identified the where all the fields which we need in the header. Now we need to get the fields to the header, so our dear report 206 developer has added a textbox to set data in the header. With this textbox we now store all the fields from the body as one long string, which we can then access from other textboxes in the header. The textbox is hidden and needs to be first thing that activated when the report is rendered. So hold that thought, it has to be hidden and at the top for Code.GetData to work. In NAV 2009 reports are rendered in Report Viewer 2008 this works like a charm, but in Report Viewer 2010 the SSRS team has been so kind to us to change the logic of how a reports is rendered. So if an textbox is hidden in RDLC 2008, the expression in this hidden textbox, is rendered at the end. So as I said the SetData textbox has to be hidden and at the top for Code.GetData to work, but now it is rendered as the last thing, and of course the result is that the fields get out of sync and the very idea using Code.GetData and Code.SetData is broken in NAV 2013 with Report Viewer 2010. Interesting thought!!! 
    But of course the NAV team came with a workaround so we all could keep Code.GetData and Code.SetData which we all love so much. Solution was to move the expression to the visibility expression, which is then rendered as the first thing when report is rendered, and Code.GetData and Code.SetData now works again. Great, now we can keep Code.GetData and Code.SetData. :-)
    But for how long, before SSRS team finds out that visibility expressions on hidden textboxes in headers are rendered as the first thing and changes this? Well, your guess is just as good as mine. But end result is that you all standard NAV 2013 reports which uses Code.GetData and Code.SetData, now have textboxes in the header which looks empty, because there is no value in them. 
    To see the actual value you will need right the textbox and select “Text Box properties” and then select “Visibility” and then expression. SSRS team thought long and hard for how to increase the number of clicks, for how to get there. Just like they have removed Value property from the property list and removed the possibility to  go directly to expression from Document Outline, just to increase the number clicks we need to go through. How fun is that!!! You would actually think that going from VS 2008 to VS 2010 would increase productivity. OK, I’m getting sidetracked, just don’t understand why they decided to make this worse than VS 2008, when so many things are great in VS 2010 compared to VS 2008. Why then remove the good things which we had in VS 2008?  
  3. OK, back on track. You hopefully now understand that we have 1 fields (4 fields in NAV 2009) added to the body of the report which contains the 54 fields we want to show in the header of the report. We have 1 empty textbox (4 in NAV 2009 non empty) which holds the data we need to show.
    So now we need to add textboxes to the header to show the data. To do this the report developer wrote i.e. “=Code.GetData(20,1)” in a textbox in the header. So in this textbox he wants show field in line 20 in group 1. Not sure why the report developer kept the group concept from NAV 2009, because he has now crammed all fields into one textbox on the body, so he could just have written “=Code.GetData(20)”, but maybe he want’s to introduce more groups in a future release?  Ok, let’s find field in line 20, in textbox in body so we actually know what “=Code.GetData(20,1)” will evaluate to when executing the report. So let’s start counting 1,2.3,4….20, found it. I feel like being in first grade again when I sit here and count lines :-(. Well maybe just me. When reaching line 20, I realize that “=Code.GetData(20,1)” has this value “Cstr(Fields!PaymentTermsDesc.Value)”, so when I run the report, Payment Terms Description will be shown in this textbox in the header. Notice that all fields now have “Cstr” in front in NAV 2013, this way our report developer is sure that all strings are strings when passed to the header. In line 16, he wants to be really sure, so he is converting stings to strings, “Cstr(Cstr(Fields!PricesInclVATYesNo_SalesInvHdr.Value))” Good job, better be safe than sorry. :-)
  4. So now you have seen where the actual fields are in the body, where SetData textbox is placed and how the actual fields in headers are created. Hopefully by now you wonder where the Code.GetData and Code.SetData functions are. So lets the find the code. Make sure you click on the body so the “Report” menu is active. BTW another feature the SSRS team came up just to add more clicks to get to things done. So if you i.e. have the cursor active in the property list, the “Report” menu is not shown. No clue why that is, but does give us the opportunity to click some more on our beloved mouse/trackpad.
    Ok, hopefully you have now found the “Report” menu. In this select “Report Properties”, and then select “Code”. In the code you will find this code which are the functions used to transfer the values of the fields on the body to the header.
    Notice that the SetData function ends with a “Return True“. This is new compared to NAV 2009, and our report developer has added this to make sure the Visibility expression always returns TRUE, so the Code.SetData textbox at the top are newer visible. Now for sure this works in NAV 2013. 

    Shared Data1 as Object
    Shared Data2 as Object
    Shared Data3 as Object
    Shared Data4 as Object

    Public Function GetData(Num as Integer, Group as integer) as Object
    if Group = 1 then
       Return Cstr(Choose(Num, Split(Cstr(Data1),Chr(177))))
    End If

    if Group = 2 then
       Return Cstr(Choose(Num, Split(Cstr(Data2),Chr(177))))
    End If

    if Group = 3 then
       Return Cstr(Choose(Num, Split(Cstr(Data3),Chr(177))))
    End If

    if Group = 4 then
       Return Cstr(Choose(Num, Split(Cstr(Data4),Chr(177))))
    End If
    End Function

    Public Function SetData(NewData as Object,Group as integer)
      If Group = 1 and NewData > "" Then
          Data1 = NewData
      End If

      If Group = 2 and NewData > "" Then
          Data2 = NewData
      End If

      If Group = 3 and NewData > "" Then
          Data3 = NewData
      End If

      If Group = 4 and NewData > "" Then
          Data4 = NewData
      End If

      Return True
    End Function

I know this is a very short explanation on how the Code.GetData and Code.SetData are used. And as you can probably read between the lines, I find this approach overly complicated. Being the Report Program Manager in the platform team of NAV for end of NAV 2009 and NAV 2013 until February 2013, you would have thought that I was responsible for this approach. But for the NAV 2013 project the NAV team was split in Platform and Application teams. And the actual design of the reports where the responsibility of the application teams But I could have affected this design strongly when I was inside the gates, but I did not, me bad!! And yes when pointing fingers I’m well aware that 3 fingers are pointing at me.

So as I said in the beginning my goal was to not use Code.GetData and Code.SetData in report 206, and when you think about it, using Code.GetData and Code.SetData is a complete workaround and not something the SSRS Team thinks much about, so there is no guarantee this will work in future version. So I urge the NAV team to work closely with the SSRS to work out a solution for this, so we in a future release can have document reports with out Code.GetData and Code.SetData. Unless of course the NAV team come up with yet another report tool for document reports in the future!

OK enough about Code.GetData and CodeSetData. Now let’s us simplify the report and get rid of all this unnecessary transferring of fields from body to header.

Redesigning report 206

I want to have each field visible in the report, so when another developer opens the report, he is not clueless of what all these <<Expr>> and Code.Get(x,x) means.
So in all it’s simplicity I’m just going to add more header lines to the main table of the report which is in the List control in Body of the report. I know this will work because we already have all the fields stored in the hidden table used for Code.GetData and Code.SetData. This works because the List Control is Grouped by the [No_SalesInvHdr], which is the Sales Invoice Header No.

image 
Then I will move all the 54 fields in header lines to the body and remove them from header.

First thing I do is to measure the size of all the fields in the header. These is around 10cm in height. So to make room to all the fields which is now going to body I need to make room for them by adding 10 cm to each element in the overall List Control. To easily get an overview of which elements that I have in my report, always use “Document Outline”:

image
Document Outline can be found in “View / Other Windows / Document Outline” or simply by hitting CTRL+ALT+T. In the List control the first thing is always a Rectangle and in my rectangle I can see that I have a textbox(Used for counting pages) 4 tables and another list control. So in “Document Outline” I simply select from the bottom, in this case the “list2” control. With the “list2” control selected I navigate to the Location property in the “Properties” and then increase the “Top” value with 10cm

Before:
image
After:

image
I repeat this for all the elements except for the “NewPage” textbox which I would like to be at the top, because I have seen this not working when not in the top of the list. So just be sure.

The I will then add new header lines to the main table in the report, in this case I’m adding 22 new header lines.

Then when the 22 new headers lines have been added I will add new columns and decrease others so I can locate the fields just like they where placed in the header. This is a bit cumbersome, but I use Excel to my calculations, then I’m sure that I leave other columns intact with same values. When you get good at this it only takes a few minutes to add new columns in a existing table.

Now the table headers are ready, so I start going by each of the fields in the header resolve the Code.GetData values to actual fields. This takes a bit of time.

When this is completed I’m pretty much done, but before I can delete the small hidden table with all fields in Body and Code.SetData text box in header, I need to make a small Page caption label because Page number can only live in Headers or Footer of a report. Notice that the label I have created becomes a parameter to the report and is not repeated in each row of the dataset. This is new thing in NAV 2013, but I dig deeper into this subject in a future post.
So with my PageCaption no longer using Code.Get, I can delete the small table which contains all fields in one textbox and delete the Code.SetData textbox in header.

Now I have 3 Images shown in report header and the Page No. The 3 images don’t work, no matter if  I select Left, Center or Right in Sales & Receivables setup Company Logo is printed to the left, so this seem not to have been tested in NAV 2013.

image

But no matter what, I don’t like the idea of having the image repeated in the dataset, just does not make sense, especially from a performance point of view. Here is a small snapshot of the dataset with the logo repeated in standard report 206.

image
Imagine what a 1 MB large company logo does to your dataset, when printing multiple Invoices with many sales lines!!!
So when designing report 206 I always delete the Images in header, mainly for performance reasons, but also because I have not seen customer yet who required the possibility to change the positions of their Company logo on Document reports. This is something which is fixed, and maybe only change when they change logo.

With the 3 images gone I add a new image, but instead of using from database, I embed the company logo to the report, because then I’m sure that the image is only sent once to Report Viewer. I took the liberty to change the logo to Abakion which is the best NAV partner in Denmark :-)

image

You can find the modified report 206 from the W1 version here in, txt, fob and a print in PDF from the demo database in NAV 2013.

 

Thanks, Claus Lundstrøm, Abakion.com

RDL vs. RDLC versions and Dynamics NAV

In this post I would like to share my thoughts on the RDL and RDLC versions released by Microsoft, explained from a Microsoft Dynamics NAV point of view. This post does not contain a matrix of what is supported in RDL vs. RDLC. If you like to see a matrix like this leave a comment and I will start to compile this Matrix, since I cannot find this anywhere on the internet. Yes I’m using Bing, so maybe that is why Smile

But lets get back to the released RDL and RDLC version released by Microsoft. I like to visualize things so let me start with this image:

RDLvsRDLC

In this image you will find 3 horizontal boxes: Server Side Report(RDL), Local Reports(RDLC) and Report Viewer.
As you can see in the image, when a new SQL Server was released, a new version of RDL is released. When a new version of Visual Studio is released a new RDLC version is released, based on the latest RDL version from the latest SQL Server release.
So when SQL Server 2005 was released, Microsoft released RDL in the 2005 format. This RDL 2005 format is described in details here: http://download.microsoft.com/download/c/2/0/c2091a26-d7bf-4464-8535-dbc31fb45d3c/rdlNov05.pdf. As you all know NAV 2009 was released in November 2008. Here we took the decision to support SSRS Reports(SQL Server Reporting Services), but not the Server Side reports but the Local Reports which we call RDLC. To get the RDLC Reports in RDLC 2005 format we needed Visual Studio to design the reports. So Dynamics NAV  is dependent on the RDLC version from latest released Visual Studio, and Visual Studio is dependent on the RDL version from latest released SQL Server. A lot of dependencies!!!

Since the Visual Studio team released Visual Studio 2005 at the same time as the SQL team released SQL Server 2005 we actually have support for designing NAV 2009 RDLC reports in Visual Studio 2005. But we have better  option and that is to use Visual Studio 2008, because Visual Studio 2008 was released before SQL Server 2008. You would have thought that Visual Studio 2008 supported RDLC 2008 but it does not. Only RDCL 2005. Since SQL Server 2008 was not released when Visual Studio 2008 was released.

Then SQL Server Team released SQL Server 2008 and upgraded RDL to the RDL 2008 format. This RDL 2008 format is described in details here:
http://download.microsoft.com/download/6/5/7/6575f1c8-4607-48d2-941d-c69622e11c32/RDL_spec_08.pdf
This was a major upgrade and especially the possibility to add fields directly to headers and footers made many people happy.
But we also had a lot confusion because RDL was at the RDL 2008 format while RLDC was at RDLC 2005 format. From NAV point of view we could read nice books about RDL 2008 but could not use much of the information since we were still at the RDLC 2005 format and many things in these books described Server Side features only supported in RDL reports.

But then Visual Studio team came to the rescue and released Visual Studio 2010 which supported RDLC 2008, so once again both SQL Server and Visual Studio was at the same version. But could we use this for NAV 2009? Unfortunately not, as this would be a breaking changes and we would have reports in both RDLC 2005 and RDLC 2008 format in a database. This would be mess, especially if you shared reports between partners, were one was using Visual Studio 2010 and the other was using Visual Studio 2008. Also what Report Viewer should be used. RDLC 2005 reports requires Report Viewer 2008 and RDLC 2008 reports requires Report Viewer 2010 so which one should open? Yes Report Viewer 2010 will convert RDLC 2005 reports to RDLC 2008 reports on the fly but this run time conversion is slow.  So to avoid all this confusion the NAV Reporting team decided not allow the RDLC 2008 format for NAV 2009. So Visual Studio 2010 is not supported to design reports in NAV 2009.

Now our friends at the SQL Server team released SQL Server 2008 R2, and with this release  a new version of RDL was released. The RDL 2010 format.
This RDL 2010 format is described in details here:
http://download.microsoft.com/download/B/E/1/BE1AABB3-6ED8-4C3C-AF91-448AB733B1AF/Report%20Definition.xps
This was a minor release compared to the upgrade from RDL 2005 to RDL 2008. But noteworthy things are support for saving to DOCX and XLSX, Vertical TextBoxes natively(Although we can do this in RDLC 2005 also, see my demo report here for how to do this in NAV 2009:http://sdrv.ms/O0SsJG), support for Spark lines and probably the most useful feature from NAV point of view, the possibility to reset page numbers. Today we need to workaround this missing feature in RDLC. Described here:
http://msdn.microsoft.com/en-us/library/dd338694
You might also want to read Robert Bruckner’s blog about how to use reset page numbers in RDL 2010 here:
http://blogs.msdn.com/b/robertbruckner/archive/2010/04/25/report-design-reset-page-number-on-group.aspx

So here we are. The latest version of RDL is RDL 2010, from SQL Server 2008 R2 and latest version of RDLC is RDLC 2008 from Visual Studio 2010. And now the NAV team is about to release NAV 2013 just before Visual Studio 2012 is released which will the support RDLC 2010. Will NAV 2013 support RDLC 2010? I doubt it, but I hope they will support it. Showing a demo of NAV 2013 and then saving a report in DOC and XLS format just seems so wrong when XLSX and DOCX formats was released back in Office 2007. Maybe just me Smile

But hold on, did Microsoft not just release SQL Server 2012? Yes they did, but did we get a new version of RDL in SQL Server 2012? No we did not. SQL Server 2012 still supports RDL 2010 no changes what so ever…
I cannot figure out if this is a good thing or bad thing. Good thing is that Visual Studio finally have a change to catch up so we can have both RDL and RDLC at the same version release. On the other hand when something does not evolve in Microsoft it means nobody is working on it, so can we expect new version of RDL in the future? Yes the RDL format has matured dramatically compared to the RDLC 2005 version we use in NAV 2009, but this is not end of the line. We need many more enhancements to the RDL format. To start with, we would like to have support for:

I guess you guys can add many more things to this list.

Thanks, Claus Lundstrøm, Abakion.com

Create a new blog and join in the fun!