InetSoft Product Information: Data Binding in a Report

Data binding is the process of associating a set of data, usually a data model or the result set of a query, with a report element. Data binding is most common with table, chart, and section elements, but can also be used with text-based elements. It can be done easily through the Designer, in which case the binding information is stored in the report template. Binding is also possible programmatically, through report scripting and can also be statically embedded into the element.

Element Data Binding

Elements can be bound to a data model, query, or asset. Data models and queries are created using the Data Modeler; see the Data Modeler Guide for more information. Assets are created using the Data Worksheet; see the Data Worksheet Guide for more information. Once a data model or a query is created using the Data Modeler, the data model or the query can be bound to a report element. If an element is bound the element contents are retrieved from the database or any other data source at runtime. The following element types can have data bindings: Table, Section, Chart, Map, Text, and Textbox. The Table and Section bindings are very similar, and the example in this section will demonstrate that. Chart and Map binding also has many similarities. Text and TextBox binding, however, is dissimilar to the other element type bindings. The unique aspects of binding to each element will be covered in the chapters below.

The ‘Data Binding’ tool is used to bind queries to elements in the Designer. An element can be bound to a data model, a query, or an asset using the Binding tool button or by right-clicking an element and selecting ‘Bind Data’. The data binding can be removed by right-clicking and selecting ‘Unbind Data’. Once the desired source of data has been selected, it is possible to refine the way it is bound to the element. For example, some columns may be hidden, conditions may be specified, and grouping and summarization may be added. The following sections explain how to bind a data set to a report element, and the sequential steps to be taken are explained in the relevant subsections.

BI DemoRegister

Choosing the Binding Data

Use the Data tab to specify the source of the dataset for binding. The following example explains the data binding process, and continues in the following sections.

  1. Select the element to which you would like to bind data (a table, for this example). Then right-click and select ‘Bind Data’
  2. Select the query ‘Orders’ > ‘Order Model’.

Data Sources Available for Binding

There are five types of data sources available for data binding:

  • Query: A query defined using the Data Modeler and stored in query.xml.
  • Local Query: A query embedded within the report template.
  • Data Model: Α data model defined using the Data Modeler.
  • Report Data: Data bound to another report element (chart, table, section).
  • Worksheet: A query created in a Data Worksheet.
  • Parameter: Α named input parameter for the report.

The data binding process is similar for the first four sources, but parameter binding has a different procedure. See Binding Data to a Text Element for an example of parameter binding.

Queries and data models are listed under their respective data sources in the tree, worksheets are listed under the ‘Worksheet’ node, and report data and parameters are listed underneath the ‘Report’ node.

Local Queries

Local Queries are listed under the ‘Local Query’ node. Local queries are regular queries that are stored within the report template rather than the query.xml file. You can create local queries using the Data Modeler.

Because local queries are not saved in the query.xml registry file, but are rather embedded within a particular report template, they are not available to other reports. You can import a global query used by a report into a local query, and a local query can be exported to the registry. Exported local queries are removed from the report.

Data source information (by default) is also embedded in the report template file. However, if a matching data source exists in the registry file, the information will be drawn from there rather than from the embedded data.