This tutorial describes how to create a data-bound report displaying information in a tabular format. Table reports should not be confused with hierarchical master-detail reports, nor with cross-tab reports.
To get started with this tutorial, open an existing reporting application or create a new one from scratch. See Adding a Report to Your .NET Application to learn how to create a reporting application on different platforms.
To print the column headers at the top of every document page, add a Page Header band to the report. To do this, right-click the report's surface, and select Insert Band | PageHeader in the context menu that is invoked.
To quickly create column headers, switch to the Field List and select the required fields by clicking them while holding the CTRL or SHIFT key. Then drag-and-drop them onto the PageHeader band with the right mouse button.
To provide dynamic content to the report, switch to the Field List again and select the same fields. Click the selected fields (while holding the CTRL or SHIFT key) and drag-and-drop them onto the Detail band.
This will create a table with the same number of cells as the number of fields selected, with each cell bound to the appropriate data field.
To select a table, click its handle, which appears when you hover the table with the mouse cursor. To select both tables simultaneously, click their handles while holding the CTRL key.
Next, press F4 to switch to the Properties window and customize common options of both tables at one time. (For example, set the Padding, Borders and BorderColor properties.)
To define the background color and customize text appearance, use the formatting toolbar.
To define a currency format for the UnitPrice cell, select the cell and click its mart tag. Then click the ellipsis button for the Format String property in the actions list that is invoked. Select the appropriate format in the FormatString editor that is invoked and click OK.
Right-align the cell's content to improve readability by setting its TextAlignment property to TopRight.
To further improve the readability of the table, you can apply different visual styles to its odd and even rows. To learn more, see Report Visual Styles.
Your report is now ready to be generated. In Visual Studio, you can view the report by switching to the Preview tab.
Consider the following best practices when creating table reports at runtime:
A sample application that demonstrates a table created at runtime is available online at Runtime table creation best practices.