Monday, November 10, 2014
From RDLC to Word: Simple steps to create Word layout
In the previous blog post, I shared how to speed up your Classic to RDLC reports transformation by using the FREE Express version of 1ClickFactory’s Classic to RDLC report transformation tool. In this post I will use the same example, show how you can easily create a word layout from RDLC, also how to get a report with both RDLC and Word layouts.
Step #1: Create Word layout
We will create a Word layout by running the report and saving its result to Word.
- Run report 5055 Contact – Cover Sheet from NAV development environment.
- Choose to print it to Word.
- Now copy the contents from the first page and paste it into the Word layout.
- Select contents in the first page.
- Now go back to NAV 2015 development environment and open the design of report 5055.
- Go to report properties and set WordMergeDataItem to Contact. This part is very important to do before inserting the new Word layout.
- From the tools menu, choose Word Layout > New.
- After the blank Word layout is inserted in report object, choose Tools > Word Layout > Export, and enter the file name where it should be exported.
- Open the exported file in Word, and paste the layout from the earlier Word file.
- Paste the content from the earlier Word document’s first page.
- Open the XML mapping window.
- Choose dataset namespace in Custom XML Part.
- Replace the text with contact controls.
- Save the Word file, and test how it looks when used in Word Layout.
Step #2: Test Word Layout
- From NAV 2015 report design, choose Tools > Word Layout > Import, and select the saved Word document.
- Save the report and run it from the development environment.
- Press Preview on the request page.
- Notice the Word message that pops up.
- Enjoy the result :)
A Happy Ending
In these two blog posts, we shared an example of how to upgrade a Classic report to NAV 2015 for free and with a functioning RDLC layout. By running the RDLC report and saving to Word, we were able to create a Word template for the report‘s Word layout design. We then replaced text with content controls and ended up with a report with both RDLC and Word layouts. Now end users can tweak the design of the report in their favorite program: Word.
Good luck in your transformation journey!
Author of the post: 1ClickFactory Associate Paulius Grigas.