Export (0) Print
Expand All

Walkthrough: Redesigning a Customer List Report

Microsoft Dynamics Nav 2009

In this walkthrough, you will learn how to redesign the Customer List report from a Classic report layout to a client report definition (RDLC) report layout.

This walkthrough illustrates the following tasks:

  • Using the create layout suggestion function to suggest an RDLC layout for the report.

  • Manually modifying the RDLC layout.

  • Saving the layout and compiling the report.

  • Transforming the report request form with the form transformation tool.

Prerequisites

To complete this walkthrough, you will need:

  • Microsoft Dynamics NAV 2009 installed with a developer license.

  • All Microsoft Dynamics NAV 2009 requirements met. For more information, see Microsoft Dynamics NAV 2009 SP1 Requirements in the Microsoft Dynamics NAV 2009 Installation and Configuration Help.

  • Microsoft Visual Web Developer or Visual Studio installed. For more information, see the Requirements for Additional Features and Options section of Classic Client Requirements in the Microsoft Dynamics NAV 2009 Installation and Configuration Help.

  • Basic knowledge of Visual Studio Report Designer. For more information, see Report Designer (Visual Studio).

Simon is a Microsoft Certified Partner working for CRONUS International Ltd. He has been asked to create an RDLC layout for the Customer List report that CRONUS currently uses with the Classic client.

The create layout suggestion function automatically suggests an RDLC report layout. Use the following procedure to create the suggested layout and view it in Visual Studio.

To create the suggested layout

  1. In the Classic client, on the Tools menu, click Object Designer.

  2. In Object Designer, click Report, select Report 101, Customer List, and then click Design.

  3. On the Tools menu, select Create Layout Suggestion. A suggestion for an RDLC report layout is created.

    NoteNote

    If you have already created a layout suggestion or have edited this report layout in Visual Studio, a message is displayed and asks if you want to overwrite the existing layout. Because report 101 is a standard application report, it already has an RDLC layout. For the purpose of this walkthrough, you can overwrite the existing layout. If you want to edit the existing layout instead of creating a new layout suggestion, on the View menu, click Layout.

    NoteNote

    You must complete the additional checks and manual modifications in the following procedures before the report layout is complete.

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 move the hidden fields

  1. 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

  2. Right-click the selected fields, and then click Cut.

  3. Right-click the row handle of the last row, and then click Insert Row Below to insert a new row in the table.

  4. Right-click the first field in the new row, and then click Paste.

  5. On the View menu, click Properties Window.

  6. 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.

NoteNote

If you plan to use the Classic report layout, then you need to keep the unsupported code. When you run the report in the Classic client, this code will run.

To add the functionality from the section trigger

  1. In Visual Studio, on the View menu, click Properties Window.

  2. 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)

  3. In the Properties window, under Appearance, expand Visibility.

  4. In the drop-down list for the Hidden field, select <Expression>.

  5. In the Expression window, enter the following expression: =IIF(Fields!CustFilter.Value<>"",False,True)

  6. Click OK.

You must save the RDLC layout, and you must also save and compile the changes in the Classic client.

To save the report

  1. In Visual Studio, on the File menu, click Save report.rdlc.

    NoteNote

    If you close the report in Object Designer in the Classic client and then make changes in Visual Studio Report Designer and try to save the RDLC layout, then you will get the Save As dialog box. This is because the RDLC layout that you are trying to save is not connected to Object Designer. When you closed the report in Object Designer, the version of the RDLC layout that was connected to Object Designer was saved in the report, and then deleted.

  2. Close Visual Studio.

  3. In the Classic client, 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?

  4. Click Yes to load the changes that you made to the RDLC layout in the Classic client.

  5. On the File menu, click Save.

  6. In the Save dialog box, select Compiled, and then click OK.

  7. Close the report in Object Designer.

In addition to creating an RDLC layout for the report, you must use the form transformation tool to transform the request form that allows you to select filters for the report.

To transform the request form

  1. Install the form transformation tool. For more information, see How to: Install the Form Transformation Tool.

  2. In the Classic client, on the Tools menu, click Object Designer.

  3. In Object Designer, click Report, and then select Report 101, Customer List.

  4. On the File menu, click Export.

  5. In the Export Objects window, enter Report101_Forms.xml for the name of the file. Browse to the folder where the Microsoft.Dynamics.Nav.Tools.FormTransformation.exe file is located, and then click Save.

  6. Edit the Microsoft.Dynamics.Nav.Tools.FormTransformation.exe.config file.

    • Change the name of the Forms.xml file to Report101_Forms.xml.

      <add key="FormsFile" value=".\Report101_Forms.xml" />
      
    • Change the name of the output pages.xml file to Report101_Pages.xml.

      <add key="PagesFile" value=".\Report101_Pages.xml" />
      
  7. Run the form transformation tool. For more information, see How to: Run the Form Transformation Tool.

  8. In the Classic client, click Tools, and then click Object Designer.

  9. On the File menu, click Import.

  10. In the Import Objects window, in the Files of type drop-down list, select XML Format (*.xml), browse to the folder where the Report101_Pages.xml file is located, select Report101_Pages.xml, and then click Open.

  11. In Object Designer, click Report, and select report 101.

  12. On the Tools menu, click Compile, and then click Yes.

  13. To view the RDLC report layout, type the following command at a command prompt:

    DynamicsNAV:////runreport?report=101

Community Additions

ADD
Show:
© 2014 Microsoft