Wyn Enterprise User Guide

Wyn Enterprise: Data Binding in Reports

The connection between a report and a dataset is known as data binding. When you connect a report to a dataset, the report extracts the information from the data source to display the required data.

Use the Data panel to connect your report to the desired dataset. This panel categorizes the available data sources into server, new based on model entity, and new based on server data source.

Dataset Types

This section elaborates about the different types of datasets supported in Wyn Enterprise:

  • Server: Datasets that are created using the report dataset designer and can be shared across many different reports. You can add this dataset type, when you want to use the dataset in more than one report.
  • New Based on Model Entity: Datasets created from a data model. These datasets are used to create ad-hoc reports. For information on creating a model entity, see this topic.
  • New Based on Server Data Source: Datasets that are defined in the report itself and are used only by that report. This means you are embedding a dataset in a report. To use such a dataset type in a report, you should have prior knowledge of SQL.

Bind Dataset to a Report

The following sections describe the different ways to bind a dataset to a report in Wyn Enterprise.

Using Server

Consider a scenario where you want to use a dataset already available on the Wyn Server. Such a dataset type is extremely useful for the non-technical users since it requires no SQL queries, parameters, or other related data options to configure it.

  1. In the Report Designer, go to the Data panel and then click the Add button to add a dataset in the report.

    Adding a dataset in a report

  2. Select a suitable dataset listed under the 'Server' such as 'Customer Orders', and then click the Add button.

    Selecting a dataset in a report

    The 'CustomerOrders' dataset is now added to your report.

Using New Based on Server Data Source

Let's say, you want to fetch data from a data source to be used only in one report. Apart from this, you want to configure its related data options such as fields, parameters, and filters to display only the required information in the report.

  1. In the Report Designer, go to the Data panel and then click the Add button to add a dataset in the report.

    Adding a dataset in a report

  2. Select a suitable dataset listed under the 'New Based on Server Data Source' such as 'Customer Orders', and then click the Add button.

    Selecting a dataset in a report

    In the Edit Data Set dialog that appears, provide the query, field, and other settings for the chosen dataset as shown in the next steps.

    Adding a dataset in a report

  3. Enter the name of the dataset in the Name field such as 'CustomerOrdersDataset'. By default, this field is set to 'Dataset1'. Note that the dataset name should not contain any empty spaces or special characters ('-', '/', '@', etc).

  4. In the Query field, write an SQL query to extract the data from the data source.

    Entering SQL query to extract data from the data source

  5. Click the Validate button to verify the SQL statement.

    Validate SQL query

    If the SQL query is successfully validated, you will see a count of queried fields against the Bound Fields field.

    View the count of bound fields in the dataset after executing the SQL query

    Click the Show Items button Show Items Button to view the entire list of bound fields in the dataset. Here, field names are the names given to the fields in a dataset, while the data fields are the original names of the fields in the database, which should not be modified or renamed.

    Viewing the bound fields in the dataset

  6. By default, field names show the same names as the data fields. You can modify a field name by simply replacing its old name with the new name as shown below.

    Editing a field name in the dataset

    To delete a field, click the Delete icon Delete Icon adjacent to the field name in the list. Note that, deleting a field here will not affect the actual data stored in the data source.

    Deleting a field in the dataset

  7. Add a calculated field in the dataset to create a new field by applying some calculations to the existing data. You can add a calculated field using the Add button Add Button Icon. For example, in the below dialog, we have created a new calculated field 'Total Price' to determine the total product cost for a customer.

    Adding a calculated field in the dataset

  8. In the Parameters field, you can add report parameters and then use the 'where' clause in the SQL query to filter the data. For example, create a parameter namely 'Country' and set its value to 'Canada', and then update the SQL statement accordingly to filter the data based on the parameter value as shown.

    Adding a parameter in the dataset

  9. To display only relevant data in the report, use filtering in the dataset. The Filters field is especially useful when you have a data source like XML that does not support query parameters.

    Filtering field in the dataset

  10. Finally, click Validate button and then OK button to save the dataset definition.

    The dataset is now added to the report.

    Viewing the added dataset in the report designer

    Click the Edit button Edit Button Icon to modify any existing data options for the dataset. It will re-open the Edit Data Set dialog.

    Editing Dataset

    Click the Close button Close Button Icon to remove the dataset from the report.

    Remove Dataset from the report

    Click the drop-down next to the dataset to view the fields in the dataset.

    Filtering field in the dataset