How to: Create RDLC Reports
To create a client report definition (RDLC) report, you:
Create a blank report and use Report Dataset Designer to add items to the dataset.
Use Visual Studio Report Designer to design the layout of the report.
To create a blank report and add items to the dataset
In the development environment, on the Tools menu, choose Object Designer.
In Object Designer, choose Report, and then choose New.
In Report Dataset Designer, the first line contains DataItem in the Data Type column. In the Data Source column, either enter a table name or table number, or choose the Assist button to select a table from the table list.
In the Name field of the DataItem line, either enter a name or verify the default name. The name must be a Common Language Specification (CLS)–compliant name. For more information, see the "Naming" section in Common Language Specification in the MSDN Library.
In Report Dataset Designer, on the first blank line, in the Data Type column, select Column from the drop-down list.
In the View menu, choose Field Menu.
The Field Menu window opens, displaying the list of available fields from the data item.
In the Field Menu window, select one or more fields that you want to add to the report dataset. Select multiple fields by holding down the SHIFT key or the CTRL key. Choose the OK button to add the selected fields to the dataset.
If you want to include the caption of a column in the dataset, then select the Include Caption check box in Report Dataset Designer. The caption is included as a parameter in Visual Studio Report Designer.
Note
If the Include Caption column is not visible in Report Dataset Designer, then on the View menu, choose Show Column, select Include Caption, and then choose the OK button.
In Report Dataset Designer, enter data items and columns until you have added all fields from all the tables that you want to include in the report.
If you want to add a label to the report, such as a caption for a table header or a title for the report, then add a label to the dataset. For more information, see How to: Create Labels for a Report.
If you want to include a variable in the report dataset, then do the following:
In Report Dataset Designer, on a blank line, in the Data Type column, select Column from the drop-down list.
In the Data Source column, enter the variable. You can use the up arrow to open the C/AL Symbol Menu dialog box and view the variables for the report.
In Report Dataset Designer, in the Name column, enter a CLS-compliant name for the variable. This name is used in the dataset in Visual Studio.
If you want to include a calculation or other source expression in the report dataset, then do the following:
In Report Dataset Designer, on a blank line, in the Data Type column, select Column from the drop-down list.
In the Data Source column, enter the source expression, such as 8*125.
In the Name column, enter a CLS-compliant name for the variable. This name is used in the dataset in Visual Studio.
On the File menu, choose Save.
In the Save As dialog box, in the ID field, enter an ID for the report object. The ID must be in a valid range for your solution. In the Name field, enter a name for the report. Select the Compiled check box, and then choose OK.
To design the report layout
On the View menu, choose Layout.
Visual Studio opens. The dataset in Visual Studio contains the dataset items that you added in Report Dataset Designer.
Use Visual Studio Report Designer to add items from the dataset to the report and design the layout of the report. For more information, see Defining a Report Layout (Visual Studio Report Designer).
In Visual Studio, on the File menu, choose Save report.rdlc, and then close Visual Studio.
In Report Dataset Designer, select a new row. A dialog box shows the following message:
The layout of report id: '<report ID>' is changed by another application.
Filename of the changed RDLC: ‘<filename>’
Do you want to load the changes?
In the dialog box, choose Yes to load the changes that you made to the RDLC layout into the report.
In the development environment, on the File menu, choose Save.
In the Save dialog box, select Compiled, and then choose OK.
To run the new report, in Object Designer, select the report and then choose Run.