[]
        
(Showing Draft Content)

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.


With the help of the Data panel, you can connect your report to the desired dataset. The Data panel categorizes the data sources into server, new based on model entity, and new based on server data source. In this article, you will learn about the types of datasets available in the Wyn report designer, steps to connect a report to a dataset, and the different ways to manage a dataset in a report.

Types of Datasets

This section elaborates on 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. You should have prior knowledge of SQL to use this dataset type in a report.

To Bind a Dataset to a Report

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

Method 1: 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 non-technical users since configuring the dataset requires no SQL queries, parameters, or other related data options.

  1. Go to the Data panel in the Report Designer and click Add.

    data-tab

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

    pick-dataset

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

    pick-dataset-1

Replace Server Dataset

In the report designer, you have an option to replace the server datasets.

ReplaceServerDataSet


Click the Replace option, the Replace Server Data Set dialog box is displayed with the Available Data Sets, Current Data Set, and Selected Data Set details.

Current Data Set and Selected Data Set details contain dataset's fields and parameters. This helps to evaluate the compatibility of the current and the target datasets visually.


Select the dataset from the list of Available Data Sets and click Ok.

ReplaceServerDataSet1

The server dataset will be replaced.

Update Server Dataset

If there is any change in the server dataset, the dataset bound to a report must also be updated. The server datasets are created and edited in the report dataset designer. While saving the modified dataset, you should choose to update the dataset version of the relevant reports, and can add a comment to maintain the revision history, as shown.


update-dataset-save


To check and update a server dataset bound to the report in the report designer, use Update option.


dataset-update-option


The Update option sets the dataset to the latest version, and a suitable notification is displayed.

update-dataset-notification-1 update-dataset-notification-2

Edit Server Dataset

In the report designer, you can easily switch to the report dataset designer to edit server dataset.

dataset-edit-option

Click the Edit option. This takes you to the report Dataset Designer in the new browser tab, where you can proceed to edit the dataset and save the changes. After the required dataset modifications are completed and saved, in the report designer make sure to update the dataset and continue designing the report.

Method 2: Using New Based on Model Entity

Let's suppose you want to create an ad hoc report for real-time data visualization and exploration. This is only possible when you bind a report to a model entity. A data model helps to transform the technical data structures from database tables and views into real-world entities, attributes, and relationships. It also helps to improve the readability of the data.

  1. In the Report Designer, go to the Data panel and click Add.

    Adding a dataset in a report

  2. Select a suitable model listed under the New Based on Model Entity category such as 'ActiveTunes'. A list of available entities in the model is displayed on selection.

    Add New Dataset based on Model Entity

  3. From the list, choose a model entity, say 'Album' and then click the Add button to proceed further.


  4. The 'Album' model entity is now added to your report.

    added-model-entity


    Duplicate Dataset

You can duplicate the datasets which are based on the Semantic model. Below is an example of the dataset based on the Semantic model.

added-model-entity-duplicated

Click the Duplicate option corresponding to an added dataset and duplicate the dataset.


Replace Semantic Model

In the report designer, you have an option to replace the Semantic Models.

Click the Replace option. The Replace Model dialog box is displayed with the Available Models, Current Model, and Selected Model details.

ReplaceSemanticModel

Replace Model dialog provides the ability to select the model and its version for replacing the current model.

replaced-model

Select the data model from the list of Available Models and click OK.


The Data Model will be replaced.

Method 3: 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 click Add.

    Adding a dataset in a report

  2. Select a suitable dataset listed under the New Based on Server Data Source category 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 the Validate button to verify the dataset definition, and then the OK button to proceed further.

    The dataset is now added to the report.


    Duplicate Dataset

    You can duplicate the datasets which are based on the embedded data source. Below is an example of the dataset based on the embedded data source.

    Dataset Based On Embedded Datasource

    Click the duplicate option to duplicate the datasets as shown below.

    Dataset Based On Embedded DataSource


    Replace Server Data Source

In the report designer, you have an option to replace the Server Data Source.

replace-serevr-datasource-option

Click the Replace option. The Replace Data Source dialog box is displayed with the Available Data Sources, Current Data Source, and Selected Data Source details.

Current Data Source and Selected Data Source detail contains Tables, Views, and Parameters sections.

> Note: If Data Source does not contain Views or Parameters, the corresponding section will not be shown.

Select the Data Source from the list of **Available Data Sources** and click **Ok**.
![replace-datasource-dialogbox](/DOCUMENT_SITE_LINK_PREFIX_HERE/document-site-files/images/8f733587-7600-4a8d-a475-99479d552355/replace-datasource-dialogbox.b659d7.png)

The Data Source will be replaced.

datasource-replaced

To Manage a Dataset in a Report

This section describes the different ways to manage a dataset in the report designer.

image

Edit a Dataset

Modify the existing details for a dataset by changing its name, parameter value(s), field name(s), filter value(s), and so on.

Delete a Dataset

Removes the bound dataset from the report.

To View Report Content for Unavailable Dataset or Data source

You can open a report in the edit mode even with an unavailable dataset or data source. On opening a report with an unavailable dataset or data source in edit mode, an error message will be displayed and the data binding panel will appear on your screen.

UnavailableData


In case a data source is unavailable, it will be marked red in the data binding panel and you can either replace or delete the unavailable data source. And, all the datasets linked to the data source will also be unavailable.

To replace a dataset, see the Replace Server Dataset section of this help article.

To replace a data source, follow the below instructions,

  1. Using the ellipses button click the Replace option.

    ReplaceOption-Datasource

  2. Replace Data Source popup will appear on your screen. Select a data source from the Available Data Sources list and click Ok. The Current Data Source section will list fields and parameters of the unavailable data source and the Select Data Source section will list the fields and parameters of the select data source.

    ReplaceDatasource

  3. Once the unavailable data source is replaced, a warning notification will appear on your screen to notify you that the datasets linked to the unavailable data source should be revised.

    Replacewarning-Datasource

  4. Revise the listed datasets and save the changes to start editing the report.

To View Report in case of Cache Dataset Errors

The default behavior is returning the empty result set instead of throwing cache errors in case of the following errors.

  • Cache storage error

  • Cache service error

  • Cache entry not found

  • Cache data being generated

  • Cache data expired

Note: An error will still be displayed in case of any error condition not matching the list mentioned above. For example: Dataset not found.

Example 1: Report with a cache dataset error mentioned in the above list.

In case of the following cache dataset error.

cache dataset error

The report will now show an empty table instead of the errors.

report preview empty

Example 2: A Report with two cache datasets. One cache dataset with an error in the above-mentioned list and another dataset without any error.

In case of the following cache dataset error.

cache dataset error 1

The report will now show an empty result for a cache dataset error in the given list and will display the report for another dataset without any error.

report 2