Datasets

Stardraw Design 7.4 exposes a collection of datasets whose fields can be used to populate reports. They are listed in the Data tab of the property inspector, on the right of the Report Designer, where each dataset can be expanded to browse — and drag onto the report — its fields.

Each dataset contains 'members'. While the Project and User datasets have only one member each (being the project itself, and you, the user) the other datasets can have multiple members i.e. every Product in the project, every Cable in the project, and every Drawing in the project.

For each member, the dataset exposes fields that can each contain a specific value for the member, as shown below. Except where otherwise indicated, the field value is of String (text) format.

The Project Dataset

The Project dataset includes details of the Project, defined in the Dashboard | Project Details view, with these fields:

Because there is only one Project that a report can reference at any given time, there is only one member in this dataset i.e. the details of the current project.

The Drawings Dataset

The Drawings dataset has one member per drawing in the Project, with these fields:

Image control properties bound to the drawing Image fieldTo use the drawing's Image in a report, first insert an Image control and set its properties as shown here. To ensure that the Image retains the correct proportions, set Image Sizing to "FitProportional".

Nested datasets: ProductInstances and CableInstances

Two datasets are nested inside Drawings, scoped to the current drawing. Use them inside a data region bound to Drawings — for example, a List over Drawings containing a Table bound to ProductInstances — to produce drawing-by-drawing reports. See the worked example below.

Worked example: products by drawing

This example produces a report in which each drawing in the Project appears with its own heading, followed by a table of the product instances placed on that drawing.

  1. From the Toolbox, drag a List onto the design area and, in the Properties panel, set its Data Set Name to Drawings. The List will repeat its contents once per drawing.
  2. Drag a TextBox into the top of the List for the heading and give it a value that mixes literal text with drawing fields, e.g. Drawing: {Name}.
  3. Drag a Table into the List, below the heading, and set its Data Set Name to ProductInstances. Because the Table sits inside a List bound to Drawings, the nested dataset is automatically scoped to the current drawing.
  4. Add fields to the Table's details row — select a details cell and pick the field from the Fields Selection Adorner (the picker offers the ProductInstances fields), e.g. Manufacturer, Model Number and Description.

List over Drawings containing a Table bound to ProductInstances

When previewed, the List repeats for every drawing in the Project: each drawing's name appears as a heading, followed by a table containing only that drawing's product instances (one row per instance placed on the drawing).

Preview - one heading and product table per drawing

Note: The same approach works for cables: a Table bound to CableInstances inside the List produces a per-drawing cable list. From here you can refine the inner table with detail grouping to collapse duplicate products into single rows with quantities, exactly as in the Table walkthrough.

The Cables Dataset

The Cables dataset includes any Attributes that are defined for the Cables in your project as well as their Cable Labels and also the identifiers and Attributes of the products each Cable connects from and to, plus the ID of any connected Feather. The fields are:

If you have removed any default Attributes listed above using Tools | Personalization | Cable Attributes & Presets then they will not appear as fields in the dataset.

The Products Dataset

The Products dataset includes product identifiers i.e. Manufacturer, Model Number, Description and ID. The remaining field names are gathered from the default Product Attributes defined in Tools | Personalization | Product Attributes. The fields are:

If you have removed any default Attributes listed above using Tools | Personalization | Product Attributes then they will not appear as fields in the dataset.

The User Dataset

The User dataset includes your details as defined in Tools | Personalization | Personal Details and includes these fields:

Because there is only one User that a report can reference at any given time, there is only one member in this dataset i.e. you.

Image control properties bound to the User Logo field

To use the Logo image in a report, first insert an Image control and set its properties as shown here. To ensure that the Image retains the correct proportions, set Image Sizing to "FitProportional".

The CableAttributes and ProductAttributes Datasets

These two datasets each expose a single field, Name, with one member per Attribute defined in Tools | Personalization — the Cable Attributes and Product Attributes respectively. Use them when a report needs to work with the list of attributes itself rather than attribute values — for example, to offer an attribute picker as a report parameter, as the "Configurable Report" template does.

Common Values

Below the datasets, the Data tab also lists Common Values — ready-made values you can drag into a report, typically into page headers and footers: Current Date and Time, Page Number, Total Pages, Page N of M, Page Number (Section), Total Pages (Section), Page N of M (Section), and Report Name.