Walkthrough: Redesigning a Customer List Report
[This topic is prerelease documentation and is subject to change in future releases. Blank topics are included as placeholders. There may be some display and formatting issues until the look and feel is finalized.]
In this walkthrough, you will learn how to upgrade the Customer List report from a Classic report layout to a client report definition (RDLC) report layout and then modify that layout.
About This Walkthrough
This walkthrough illustrates the following tasks:
Importing and upgrading a report that has only a Classic report layout to a Microsoft Dynamics NAV 2013 report, which has an RDLC layout.
Manually modifying the RDLC layout.
Saving the layout and compiling the report.
Creating a new request page for the report.
Prerequisites
To complete this walkthrough, you will need:
Report 101 with only the Classic report layout. To create this report, in Microsoft Dynamics NAV 2009, delete the RDLC report layout and then export the report. For more information about how to delete the RDLC layout, see How to: View Classic Report Layouts from the RoleTailored Client.
Microsoft Dynamics NAV 2013 installed with a developer license.
All Microsoft Dynamics NAV 2013 requirements met. For more information, see Microsoft Dynamics NAV 2013 Requirements.
Microsoft Visual Studio 2008 SP1 (Professional) installed.
Basic knowledge of Visual Studio Report Designer. For more information, see Report Designer (Visual Studio).
Story
Simon is a Microsoft Certified Partner working for CRONUS International Ltd. He has been asked to upgrade the Classic version of the Customer List report that CRONUS used in previous versions of Microsoft Dynamics NAV.
Importing and Upgrading the Report
Upgrading a Classic report deletes the request form, automatically creates an RDLC report layout, and upgrades the report to be valid for Microsoft Dynamics NAV 2013. Use the following procedure to import a Classic-only report and upgrade it.
To import and upgrade a Classic report
In the development environment, on the Tools menu, click Object Designer.
In Object Designer, click File, and then click Import.
In the Import Objects window, navigate to the report object that contains only the Classic report layout, and then click Open. If prompted, click OK to open the Import worksheet to resolve any conflicts.
Warning
Before you replace the existing version of report 101 in your demo database, we recommend that you create a backup of the report by exporting the report to a file. For more information, see How to: Export Objects.
In Object Designer, click Report, select Report 101, Customer List, which you imported in the previous step, and then click Upgrade Reports.
In the dialog window, click Yes to confirm that you want to upgrade the report.
In the Tools menu, click Compile to compile that report that you upgraded in the previous step.
Modifying the Customer List Report RDLC Layout
Hidden fields in the RDLC report layout will cause formatting problems when you print the report because these fields are outside the width of standard paper. To eliminate the formatting problems, you must move these hidden fields to another location on the report that is within the width of standard paper.
To open the report in Visual Studio Report Designer
- In Object Designer, select report 101, click Tools, and then click Layout. Visual Studio Report Designer opens.
To move the hidden fields
In Visual Studio, in the Report.rdlc file that was created, in the Body section of the layout, select the following hidden fields on the right side of the table:
=FIELDS!COMPANYNAME.VALUE
=FIELDS!Customer__ListCaption.VALUE
=FIELDS!CurrReport_PAGENOCaption.Value
Right-click the selected fields, and then click Cut.
Right-click the row handle of the last row, and then click Insert Row Below to insert a new row in the table.
Right-click the first field in the new row, and then click Paste.
On the View menu, click Properties Window.
Select the new row. In the Properties window, under Layout, change the value of the Height property to 0.2cm. The height of 0.2 cm is large enough that you can view the row in the layout but small enough that it will not cause formatting problems when you print the report.
This report has unsupported code for the RoleTailored client on the section trigger for Customer, Header (3). You must add the functionality for this code elsewhere in the report so that it will run in the RoleTailored client report.
To add the functionality from the section trigger
In Visual Studio, on the View menu, click Properties Window.
In the Report.rdlc file, in the Body section of the layout, select the field at the top of the layout with the following value:
- =First(Fields!Customer_TABLECAPTION__________CustFilter.Value)
In the Properties window, under Appearance, expand Visibility.
In the drop-down list for the Hidden field, select <Expression>.
In the Expression window, enter the following expression: =IIF(Fields!CustFilter.Value<>"",False,True)
Click OK.
Saving the RDLC Report Layout
You must save the RDLC layout, and you must also save and compile the changes in the Microsoft Dynamics NAV 2013 development environment.
To save the report
In Visual Studio, on the File menu, click Save report.rdlc.
Close Visual Studio.
In the Microsoft Dynamics NAV 2013 development environment, select an empty line in the report in Object Designer. The following message appears:
The layout of report id: '101' is changed by another application.
Filename of the changed RDLC: <filename>
Do you want to load the changes?
Click Yes to load the changes that you made to the RDLC report layout.
On the File menu, click Save.
In the Save dialog box, select Compiled, and then click OK.
Close the report in Object Designer.
Creating a Request Page
Upgrading a report deletes the request form. You use Page Designer to create a new request page.