Transfooter and Transheader warning

Last week I did another RDCL Report Training class, this time in UK. In this class we stumbled over an issue, I had never seen before, while we where implementing Transfooter and Transheader functionality in a report. You might never encounter this issue, but to save you the headache I got solving this issue, here is the solution or bug you might call it.

You might remember the Transfooter and Transheader solution I blogged about a few years ago here: http://blogs.msdn.com/b/nav/archive/2011/06/06/transfooter-and-transheader-functionality-in-rdlc-ssrs-reports-revisited.aspx. This solution also works perfectly in NAV 2013 and Visual Studio 2010. I have upgraded the report to NAV 2013 and made some layout changes to it. You can download the new version here from my SkyDrive: http://sdrv.ms/191AC0g.

But back to the problem. While we were adding Transfooter and Transheader functionality to the report, we also played around with the LeftIndent property on the textbox that feeds information to Transfooter Text box in the Page Footer. In the above demo report this would be Text Box “Customer__Debit_Amount_”.
When i.e. setting the LeftIndent property to 5pt to this specific Text box, we suddenly got and error in the Transfooter Text Box:

image

Why that is, I have no clue, but I have stopped using LeftIndent, since I no longer trust that property.

If you have an idea why the Transfooter Text box gives an error when using LeftIndent, I would love to hear. If not I will just park this as yet another bug in Visual Studio.

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

Fixing Inventory Valuation report

When running Inventory Valuation report you might have experience that the data in this report is not visible in Print Preview like this:

image

Inventory Valuation is not the only standard report with this problem. I.e. you will also see this problem in the Account Schedule in the NA(North America) version.

Easy workaround is of course to click the “Print Layout” button, if this is visible of course, and the report looks like this:

image

But in this blog post I want to fix the report so the report also shows all the data in “Print Preview” and not just “Print Layout”

The fix is easy, and it is clear that this report was not completely fixed after the rules in UX Guidelines. In the UX Guidelines it is outlined that cell padding should be:

Padding
Left: 5pt
Right: 5pt
Top: 0pt
Bottom: 0pt

but the cell padding is the default values in this report:

Padding
Left: 2pt
Right: 2pt
Top: 2pt
Bottom: 2pt

I don’t want to mess with the report to much so the only thing I will change is the Top and Bottom padding in this report, and which is not needed in this report. 
So I will change both Top and Bottom padding to 0pt.

You have 2 options for making these changes:

Option 1. Export the report as txt and search and replace the following:

Replace <PaddingTop>2pt</PaddingTop> with <PaddingTop>0pt</PaddingTop>

and

Replace <PaddingBottom>2pt</PaddingBottom> with <PaddingBottom>0pt</PaddingBottom>

and then of course import the txt file again.

Option 2. Make the changes in Visual Studio by right clicking on the Report.rdlc in the Solution Explorer and select Open With / XML (Text) Editor, and do the same search and replace as above.

Save, compile and run you’re the report, and the report now looks like this in Print Preview with all data shown:

image

It would of course be nice if the NAV team would fix this. It only takes 2 minutes to fix Smile

Or request the SSRS team to fix the Report Viewer so it shows the data just like in Print Layout. This would of course not be a 2 min. fix, and this issue would not be on my top priority list for things the SSRS team should fix, If had the luxury of prioritizing what they should fix.

I dedicate this blog post to Kamil Sacek

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

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

Create a new blog and join in the fun!