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

  1. Right-click a blank area of the report body and choose Section | Add Footer (or Add Header) — see Page Headers and Footers.
  2. 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

  1. Add a page header (as above).
  2. From the Data panel, drag fields from the User dataset (Company, Address, Phone…) into the header.
  3. 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

  1. Attribute values are stored as text, so convert the value to a number in the cell's expression: {ToDecimal([Cost Price])} — see Expressions.
  2. 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:

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:

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.