Report Builder was unable to paste successfully

If you found this page you might have seen this error when trying to copy 1 or more elements in Visual Studio when designing a Report: “Report Builder was unable to paste successfully

This issue is that 1 of the selected textboxes you are trying to copy has custom code in it, and then you cannot copy the textbox(es).

I.e. you cannot copy a textbox with this custom code: “Code.MyCustomeCode()

Well actually it is not an issue it is bug, which have existed many years now and Microsoft promises to fix the issue in a future version, see here and please vote:

Well future version is a bit a tricky dear Microsoft since nothing has happen since SQL Server 2008 R2, see my blog here:

So let me give you 2 workarounds. The obvious one, but hard and then the easy one.

Option 1, obvious one, but also hard if you have many textboxes with custom code:

1.Open the Expression and copy the custom code in the expression

2. Close the Expression

3. Create new textbox

4. Open Expression, and paste the custom code

5. Now set font, padding and size just like the other textbox

Option 2, the easy one:

1. Open the textbox with custom code

2. Now add a comment after the custom code.
I.e. “Code.MyCustomeCode() ‘This is my custom code’

3. Close the Expression

4. And copy the textbox

Don’t ask me why this is working, but now you have a good reason to comment your code. If you´are designing an ISV solutions or if you are the NAV team and have custom code in any of your reports be kind to add a comment in the expression so developers after you can copy your text boxes.

/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV

RDL vs. RDLC versions and Dynamics NAV v.2

A few years ago I wrote a blog post outlining when each version of RDL(Server side Reporting, not supported out of the box in NAV) and RDLC(Client Side Reporting, supported in NAV) was released and which are supported in which version of Dynamics NAV. During my many Report training classes I always start explaining this chart in details.

I have trained over 500 NAV developers now and as always if you have been at my training, you are more than welcome to contact me if you think there was something I missed talking about during the class you attended and then I will of course guide you in the right direction for free. This way my training class just gets better and better since I don’t like to give to much free support :-) The next couple of months will be pack with training classes mainly in Denmark, Belgium and USA. If you are interested just leave your contact details here:

But back to point…

Since the NAV team has been real busy is is time for an updated chart which explains when each version of RDL and RDLC was released. It also clear in this chart that the SSRS team in the SQL team, responsible for RDL is planning something big in the next version since nothing has happen since SQL Server 2008 R2, or they have stopped improvements to RDL. We all love updates and improvements, when the upgrade is easy, so let us bet on them making RDL better in next version of SQL Server. Not sure we will win that bet though, but let’s hope.
The Chart should be self explanatory, but if you join my training I will of course explain it in details:


/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV &

Export images from RDLC report using Excel

In this small tip I will show you have to export images from a RDLC report in NAV 2013 R2. You can do this in NAV 2009 and NAV 2013 also, but then you need to convert the Excel Spreadsheet to the latest version.

Scenario A: You have embedded a image into a RDLC report and no longer have access to the original image, and for some reason you need to extract the images out of the report.

Scenario B: You would like to export i.e all item images so you can have access to all them in one folder, for this you will of course need to create a report which runs through all items and shows the image. If you don’t have a report like that, have a look at my demo report here:

Here is what you need to do.

1. Print your report to Excel and save it to disk as Report.XLSX. In NAV 2013 R2 the report will have the extension XLSX. Notice that neither NAV 2013 nor NAV 2009 will produce XLSX format here you will get XLS, the old Office 97 format.

2. Rename the Report.XLSX to Report.ZIP

3,. Now open the Report.ZIP in Explorer

4. Navigate to the folder “XL/MEDIA” and here you will find all the images which are in the report.


Note to do the same in NAV 2009 and NAV 2013, save the report as Report.XLS, then open the report.xls in Excel 2007 or newer and save as XLSX format. Then you also have access to the images, by renaming the Report.xlsx to


/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV &

How Do I: Create Transfooter and Transheader in Microsoft Dynamics NAV 2013 R2

Some of you might have noticed that I started doing a few “How Do I” videos for Microsoft.

All the “How Do I” videos, not just the ones I have done, can be found here:

But the latest one I did, is not on the list yet. When you read this, the list is probably updated and the “How Do I: Create Transfooter and Transheader in Microsoft Dynamics NAV 2013 R2” has been added.

You can watch this “How Do I” video here on YouTube:

But this blog is not to complain that this list has not been updated, but only to point you to the Report Object which I’m uisng in this “How Do I” video.

So if you want to have a closer look at the report object, it is located here on my OneDrive:

/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV &

Convergence 2014 Session now available on demand

Did you not attend Convergence 2014 a few weeks ago, or do you want to see the presentations once again. View the Convergence 2014 sessions here:

You need to click the “Register Now!” to get into the goodies.


/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV &

Visual Studio 2013 is now supported in NAV 2013 R2

We now have support for Visual Studio 2013 with NAV 2013 R2 when designing reports.


Apply this hotfix:;EN-US;2907585, and you will then open your layout in Visual Studio 2013 if installed.

Why can we use Visual Studio 2013? Because it also supports RDLC 2010 supported in NAV 2013 R2. Here is a small overview of the different RDLC versions and NAV versions and Visual Studio versions:

RDLC 2010 = NAV 2013 R2 = Visual Studio 2013 Pro(New), Visual Studio 2012 Pro or Report Builder 3.0

RDLC 2008 = NAV 2013  = Visual Studio 2010 Pro, or Express using this tip here

RDLC 2005 = NAV 2009  = Visual Studio 2008, read more here. Do not use VS2005

Not a single of the bugs introduced in Visual Studio 2012, which I know of, has been fixed, except the possibility to use the LEFT ARROW key in expressions. In Visual Studio 2012 this is not possible. Now with Visual Studio 2013 we can now use the LEFT ARROW key. So if this is driving you crazy, go and apply above hotfix and start designing you R2 reports in Visual Studio 2013.

/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV &

And the Winner is…1ClickFactory – Updated

This has been a fun week. Everybody who knows me are well aware that I always like a good competition, and also that I really hate to lose.

But 1ClickFactory upgraded the Service Contract report 5970, in less than 8 minutes. that is pretty impressive guys. So 1ClickFactory is the winner of this weeks competition if you ask me, and yes I lost, but my report was better looking. Smiley

If you missed this weeks competition you can watch me upgrade the Service Contract report 5970 manually, and Daniel Parker from ArcherPoint using the YAVEON Report Converter here, neither Daniel or I completed the report 100%, I was very close so with 10 min more I would have been done. This recording can be found here: The sounds is terrible so I’m really considering reshooting my manual upgrade of this report. If you would like me to do this, leave a comment, and I will do this if many people request this.

If you want to watch the winner video from 1ClickFactory go here:

Here are few pros and cons for each of the solutions from my point of view:

Manual Upgrade:


- You become an expert in creating RDLC reports and know how to create new reports going forward.
- You will utilize many of the new capabilities and not just have a doll classic report upgraded


- Expensive to learn how to do the RDLC reports correctly. Learning on the job is hard, because Visual Studio has its own life, and does not do what we expect it to do. You need to learn all the tips and tricks. And what works and what does not work. Report training is strongly advised. And yes I do training, but I don’t write this just for you to hire me, but if you attend a training class in RDLC I strongly recommend you verify that the trainer has upgraded many reports. If not you will just get a lecture of what you already yourself can find on the internet.

- Could easily be more costly than using a Report transformation tool, if you are not fast. And you are not fast in the beginning because your struggle.

YAVEON Report Converter


- You can stay in your comfort zone, Classic report designer and do all tags 
- Only has a upfront fee so if you many reports, and you get good at this tool, this might be the tool to consider. But really you have to be fast in creating tags to compete with the 1ClickFactory solution. If you have purchased the tool, you can use it everywhere. So not limited to one customer or one report developer.


- You do not learn how to design RDLC report. How do create new report?

- Learning curve for putting in the right tags in Classic designer

- Document Outline in Visual Studio is unnecessary crowed. If you do not use Document Outline when designing reports, this might of course not be a problem for you, but I use Document Outline all the time.

- You get a dull Classic report look and feel

1ClickFactory Report transformation service


- Lightning fast

- You get to learn how to do RDLC reports a little bit, since reports will only be upgraded 60%-80%

- Nice add in tool for moving things to Page header, but really we should only have Report Title, Page number and Images in header. Having i.e. 54 fields in header using Code.Set and Code.Get is crazy.. So this is just a show off tool, you should just place a repeating row outside main group, like I showed SmileyIf you cannot figure that out, this move to header tool is great and saves tons of time.


- Not a onetime fee, as YAVEON’s tool

- 16 clicks for report 5970 is a bit overpriced. 1 click = 15 min. of work. I know 1ClickFactory says that it would take a average Report developer 4 hours to upgrade this report. I would say it should not take more than 2 hours for a report developer, who has been at a report training class, Still 1ClickFactory would probably be cheaper, depending where your are in the world of course

- Just like with YAVEON, Document Outline in Visual Studio is unnecessary crowed. Update: The Document Outline is actually great. Please find on my SkyDrive the Document Outline which we did not see in the 1ClickFactory presentation. You can also find the upgraded report from 1ClickFactory and my manual upgraded report. My report was only 98% completed.
Files are found here:

- And you get a dull Classic report look and feel


So I really want to love these Report convert tools, but end of the day you need to understand how to design RDLC reports, that is my opinion of course. So I would definitely invest time in understanding how to design RDLC reports, and when you have this knowledge, you can decide to upgrade the next 200 hundred report or how many you have using either 1ClickFactory or YAVEON’s tools.
If you disagree and do not want to be an expert in RDLC reports. These tools are your new friend, if you of course are not already using them. Both YAVEON and 1ClickFactory give you the option to try out their tools for free. YAVEON has a trial version, Contact Andreas H.E. Dorsch: for a trial version. This weeks winner, 1ClickFactory, will give you 20 clicks for free, so you can check out how cool their service is.

/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV &

Report Transformation Competition–Updated

Holiday season is upon us and it is time for a little competition.

On Monday 9th of December you will have the opportunity to join a 2 hour Report Converter Webinar hosted by YAVEON.

In the first hour, I will I transform a report all the way from NAV 5.0 to the brand new NAV 2013 R2. To be specific I will transform the Service Contract report ID 5970.

The Service Contract contains all the elements which can be found i.e. the invoice report ID 206. So this is a good report to practice on, when learning how to design Document reports

I will manually upgrade this report, using many of the tips and tricks which I have only shared at my Report Training classes. Of course this only being an hour I will not have the opportunity to share them all.

If you tune in on Monday I will also show a new trick, which I currently have only shown to 2 people. This will speed up report writing even more, and yes of course I will blog about this later when time permits.

Since this is a competition and I hate to lose ;-) I will upgrade the report quite fast, so I might not get every step explained in details, but you can at least see all the steps I take, and then hopefully the Webinar will be made available for download. afterwards.

In the second hour, Daniel Parker from ArcherPoint will show how to upgrade the exact same report, the Service Contract ID 5970, using YAVEON Report Converter. And of course upgrade this to NAV 2013 R2 as well.

Daniel Parker is an expert in using the YAVEON Report Converter, so I’m excited to see how fast he can do this and if he can get the report to look as cool as mine, and not just as doll as the Classic report ;-)

If you want to see me cry, because Daniel is faster, sign up for this 2 hour Report Converter Webinar hosted by YAVEON here:

I believe there is limit of 50 online viewers, so you might want to hurry up if you want a seat.

If you are interested in purchasing the YAVEON Report Converter tool, contact Andreas H.E. Dorsch

But before I end this blog post, you might also have heard that 1ClickFactory also have a Report Transformation tool. This tool differs from the YAVEON Report Converter. For the YAVEON Report Converter tool to work, the report developer are required to insert tags in the Classic report, which then guides the YAVEON Report Converted tool to transform the report correctly. This is what Daniel Parker will show. What 1ClickFactory offer is to convert the report 60-80% and then the report developer will need to make the final adjustments in Visual Studio to complete the report.

On Thursday 12th of December, 1ClickFactory is also hosting a Webinar. This Webinar is not exclusive, because Daniel and I are not be presenting Smiley, der blinker, but I would really like to challenge 1ClickFactory to also show how they upgrade the Service Contract report ID 5970, not just 60%-80% but 100%, and to make it look good as well and upgrade it to NAV 2013 R2.

Because if they do this on the 12th of December, it will be very easy for the whole NAV community to compare which solution is best, and what strategy to take when upgrading Classic report to RDLC:

1. Doing a manual upgrade, Like I do

2. Using the YAVEON Report Converter

3. Using 1ClickFactory Classic report to RDLC transformation service

So Phillip Rubino if you read this, please accept this challenge so we all can compare and see which of the above 3 solutions are the best.

Update: 1ClickFactory has accepted the challenge, see more in comments. So next week you will have the option see all 3 ways of upgrading the same Classic report.
Let the best man or tool win next week Smiley

/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV &

When to use PadRight to add Leading Dots and when not to use PadRight

In my now many report training classes I have always shown a small example on how to use the PadRight method to extend the string with additional dots(.), also called Leading Dots. I.e. like this:


In left column I have just added the Customer Name, while in the second column I’m using the method PadRigth to add additional dots(.) to the Customer Name string.
To accomplish this I have the following custom code in my Report:

Public Function MyPaddedString(ByVal Value As String)
    Return Value.PadRight(100,".")
End Function

And then in my expression in my right column I have this expression:


This works fine, but I have always found that the dots(.) are to close to each when usign PadRight, so I have usually challenged the people attending my report class to come with a solution to add more space in between the dots(.), and now finally somebody, Christian Bockelmann from Agiles, took the bait and came with a solution, which I would like share with all of you.

What Christian is doing is not using the PadRight method, but checking on the lenght of the Customer Name and then applies a space and dot(.) until he reaches 100. Just like in my above PadRight soluiton.

Public Function MyPaddedStringUsingLength(ByVal Value As String)
  while(Value.Length < 100)
    if(Value.Length <> 99) then
      Value = Value + " ."
      Value = Value + " "
    End if
  End while
  Return Value
End Function

Actually quite simple. So with Christians solution I can now add a new column to my PadRight example:


In the new column to right I have the following expression:


And as you can see the leading dots now looks much better since they are now all seperated with a space.

If you want, you can download the solution here on my SkyDrive. It’s in RDLC 2008, NAV 2013 version, but you can easily upgrade to NAV 2013 R2 if you want or apply the above code to RDLC 2010 if you want. If you are not using Dynamics NAV, just open the OfflineFolder and open the solution file “OfflineReport.sln” with Visual Studio 2010 Pro or higher version of VS2010. Express version does not work with Offline Reports.

Thanks again Christian for this simple solution

/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV &

Using Template reports for faster RDLC report writing

When designing RDLC reports it is an advantage to have all the report controls which you often use close at hand. As many you know I give out my template reports when you attend one of my many RDLC Reporting Training classes, but after multiple requests I now also place these Template Reports on my public SkyDrive. If you want to use or modify them it is of course up to you, but these template reports increases my speed when I create RDLC reports, so maybe they can also help you become faster when designing RDLC reports.

Here is an image of my Portrait Letter template report for NAV 2013 R2:


Every time I design a new report I will get this report shown to me. To accomplish this I replaced the existing report.rdlc file found in the ReportLayout folder in the RTC folder.

As you see I have quite a few elements on this report. Notice that all elements are using the rules outlined in the Report UX Guidelines released by Microsoft now almost 2 years ago. A bunch of standard reports in NAV 2013 and NAV 2013 R2 have been designed after these guidelines. Please notice that the Report Guidelines says that you need to use textbox height of 10 pt. This is a unfortunately a mistake. If you use 10 pt. height in your textboxes AND 8 pt font size you will in some cases have the bottom of the letters: j, g and p cut of. To avoid this I’m now using 11pt. in height for all my cell heights, except the title which needs to be 20pt. in height and 14pt. font size. For font I’m using Segoe UI. Segoe UI, is the standard font use in Windows.

If you are curious about the guidelines for Windows read more here:
And specific for the font Segoe UI, read here:

In the Page Header I have the following textboxes:

1. Title which says INSERTTITLE. Title is unique to each report so you need to change this.

2. Company name. Here you need to insert Company name information. Since I cannot have data bound fields in my template report you will need to add this as well.

3. Execution Time. This field is not data bound, so you can just leave this field

4. Page Caption and PageNumber. Here PageNumber is not data bound while the PageCaption is, so you will need to add the PageCaption to your dataset and add this to this textbox. Notice that you will need to delete “INSERTPAGECAPTION” and create a new placeholder to add you new PageCaption from dataset, since I already have 2 Placeholders in this Textbox. If you don’t like this, just modify the template report, so it fit your needs.

5. Spacer. Just below the CompanyName I have a spacer which is 20pt in height as outlined in the Report UX Guidelines. In some standard reports this spacer has been removed after the report developer has designed the report, but I find it good practice to keep this, since it is much easier to keep this space between the header and body when you make modifications.

I often just open my Template report and copy the page header part over to an existing report where Page header is missing or not designed correct. Therefore I have place a rectangle around all my elements in the page header so it easy to copy the rectangle, since this will just include all of the above fields.

In the Body I have added the 3 different tablixes all with the correct dimensions according to the Report UX Guidelines. Correct height 11pt. for cell height, font set to Segoe UI, just like I have in my page header.

When I create RDLC report I constant need 1 or more of these Tablixes in my report. And having these tablixes setup correctly is a huge time saver for me. I.e. I have set the following up the Tablix used for list reports:

  • Correct font used
  • Correct Cell height used
  • Correct Padding used(Notice that I cheat and set everything to 0pt, and only add 5pt. as outlined in Guidelines when needed. The cost of having 5pt left padding and 5 right padding in document is using to much space in document reports )
  • Greenbar effect in the list(WhiteSmoke every second line)
  • Table created as 4 rows, Outlined in Guidelines here:
  • Again I’m cheating by adding hidden row in the table header. I do this to avoid Visual Studio adding default hardcoded captions to my report.
  • Added so all Header Table rows are repeated when detail rows spans more than one page. Not sure why this is not just standard in Visual Studio, and why this is so much hidden, and not just work in the Tablix menu, where these buttons don’t work at all, or I’m not smart enough to get them working. If you can get any these button working, I will invite the first person who will accomplish this to noma the world best restaurant situated in Denmark. I will not pay for your trip Denmark, only the restaurant :-) Watch the video, it is great fun. :-)
    So once again none of these buttons work in the Tablix property page in Visual Studio 2010, 2012 and 2013. The worked fine in Visual Studio 2008. Maybe the responsible guy for these buttons left Microsoft when Visual Studio 2008 was released… ;-)


Also in my template I have few code snippets I use:

  • Our bellowed SetData and GetData used in all standard document report. I have simplified the code to not use groups, since this concept was discontinue in NAV 2013 but unfortunately the code was not simplified. I rarely use the GetData and SetData in my document reports. Only real reason is when the customer request that the Page number is not in the top of page(Page Header) or bottom of the page(Page Footer), because it is impossible to get the page number in the Body of the report. So if this is a requirement I am forced to use SetData and GetData.
  • Divide by zero protection: 5 times I have now seen that doing Divide by Zero protection inside Expression not working, so it has now become best practice for me to do pass the 2 values to my Function DivideValues

Notice that I have also set the correct values in the Report Properties so margins are set correct based on the Report UX Guidelines. This also the main reason I have A4(Portrait), A4(Landscape), Letter(Portrait) and Letter(Landscape) in my template folder.

You can find my template reports for NAV 2013 and 2013 R2 here on my SkyDrive, and if you prefer to have them as objects in your database instead you can also import them. These reports have a little more added since the data bound compared to single Report.rdlc which we just copied into “C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client\ReportLayout”

I hope your speed of creating reports will increase by using my Template reports. If the do not fit your setup, I urge you to create your own, because these are a huge help when creating and modifing reports. You can also just have different report.rdlc files places in a folder which you can just open in Visual Studio and copy from when needed.

/Thanks, Claus Lundstrøm, MVP for Microsoft Dynamics NAV &

Create a new blog and join in the fun!