Common Tasks
Quick recipes for the things report authors ask for most often. Each recipe gives the short version; follow the links for the full explanation.
Add page numbers to every page
- Right-click a blank area of the report body and choose Section | Add Footer (or Add Header) — see Page Headers and Footers.
- Open the Data panel and drag the Page N of M Common Value into the footer. A TextBox is created that renders as e.g. "Page 1 of 10".
Put your logo and company details in the page header
- Add a page header (as above).
- From the Data panel, drag fields from the User dataset (Company, Address, Phone…) into the header.
- For the logo, add an Image control, set its Source to Database and its Value to the User dataset's Logo field, and set Image Sizing to FitProportional so it keeps its proportions.
For project (rather than personal) details — Title, Reference, Client Name and so on — use the Project dataset instead, as the sample reports do in their letterheads.
Show a value as currency
- Attribute values are stored as text, so convert the value to a number in the cell's expression: {ToDecimal([Cost Price])} — see Expressions.
- Select the TextBox and set its Format property (Text section) to C2 — currency with two decimal places. Date fields work the same way, e.g. dd/MM/yyyy. See Common Control Properties.
Shade rows or highlight values conditionally
Style properties accept expressions, so a cell can change its appearance based on the data. For example, select the details-row cells and set:
- Background Color to {IIF(ToDecimal([Cost Price]) > 1000, "Gainsboro", "Transparent")} to shade expensive items,
- Background Color to {IIF(RowNumber() Mod 2 = 0, "WhiteSmoke", "Transparent")} to shade alternate rows — banding that makes wide tables easier to read, or
- Font Weight to {IIF(Type = "New", "Bold", "Normal")} to embolden particular rows.
Enter the expression via the property's value menu (Expression...) or type it directly into the property field.
Number the rows in a data region
Add a column for the numbering (e.g. headed "No.") and set its details cell according to how the data region is organized:
- Plain (non-grouped) details: use {RowNumber()} — a running count of the rows, so each detail row is numbered 1, 2, 3… down the region.
- Grouped results: RowNumber() counts the underlying dataset records, so where grouping collapses several records into one row the numbering would jump (1, 4, 5, 9…). Instead use {GroupIndex() + 1}, which numbers each displayed row 1, 2, 3… (the index is zero-based, hence the + 1).
See Expressions for the RowNumber and GroupIndex functions.
Repeat a table's column headings on every page
Select the Table's header row (click its row handle) and set the row's RepeatOnNewPage property to True. The same property is available on group header and footer rows.
Start each group on a new page
Select the group (via the Groups widget, or right-click the Table and choose Edit Group) and set its Page Break property to Before (or Between/After) — see Manage Page Breaks in Data Regions.
Show a message when there is no data
Data regions (Table, List, Tablix, Banded List, Subreport) have a No Rows section in the Properties panel: set its Message (e.g. "No cables in this project") and it will be rendered, with its own text styling, whenever the bound dataset returns no rows.
Collapse duplicate rows into one row with a quantity
Use detail grouping: group the details on the identifying fields (e.g. Manufacturer then Model Number) and add a {Count([Model Number])} column. The full walkthrough is in the Table topic, with the concept explained in Groups.
List products or cables drawing-by-drawing
Bind a List to the Drawings dataset and place a Table bound to the nested ProductInstances (or CableInstances) dataset inside it — see the worked example in Datasets.