[]
        
(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 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. You should have prior knowledge of SQL to use such a 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.

    Adding a dataset in a report

  2. Select a suitable dataset listed under the Server category 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.

    Viewing the dataset


    Replace Server Data Set

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

    replace_serverdatset_option


    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 Data Set's fields and parameters. This helps to evaluate the compatibility of the current and the target Data Sets visually.


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

    select-avaialble-dataset-serverdataset

    The server data set will be replaced.

    server-dataset-replaced

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.

    Selecting a dataset in a report

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

    Selecting a dataset in a report

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

    Viewing the added model entity in the report


    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.

    Dataset Based On Semantic Model

    After adding the dataset, click the duplicate option to duplicate the datasets as shown below.

    Dataset Based On Semantic Model


    Replace Semantic Model

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

    replace-semanticmodel-option

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


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


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

    available-models-list

    The Data Model will be replaced.

    datamodel-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.

    Viewing the added dataset in the report designer


    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


    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.

  • 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.

    Editing Dataset

  • Delete a Dataset: Removes the bound dataset from the report.

    Deleting Dataset

To View Report Content for Unavailable Dataset or Datasource

With the Wyn Release version v7.1, you will be able to 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 Dataset section of this help article.

To replace a data source, follow the below instructions,

  1. Using the ellipses button click the Replaceoption.

    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

By default, the dataset plugin’s data endpoint returns an empty table with correct columns instead of cache errors when the report is requesting data from a cache dataset. It occurs in the case of the following cache errors:

  • Cache storage error

  • Cache service error

  • Cache entry not found

  • Cache data being generated

  • Cache data expired

Example:

In the case of the following cache dataset error.

cache dataset error

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

report preview empty