- Getting Started
- Administration Guide
- User Guide
- Developer Guide
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.
Go to the Data panel in the Report Designer and click Add.
Select a suitable dataset listed under the Server category such as 'Customer Orders', and then click the Add button.
The 'CustomerOrders' dataset is now added to your report.
Replace Server Data Set
In the report designer, you have an option to replace the server data sets.
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.
The server data set will be 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.
In the Report Designer, go to the Data panel and click Add.
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.
From the list, choose a model entity, say 'Customer' and then click the Add button to proceed further.
The 'Customer' model entity is now added to your 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.
After adding the dataset, click the duplicate option to duplicate the datasets as shown below.
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.
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.
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.
In the Report Designer, go to the Data panel and click Add.
Select a suitable dataset listed under the New Based on Server Data Source category such as 'Customer Orders', and then click the Add button.
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.
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).
In the Query field, write an SQL query to extract the data from the data source.
Click the Validate button to verify the SQL statement.
If the SQL query is successfully validated, you will see a count of queried fields against the Bound Fields field.
Click the 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.
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.
To delete a field, click the 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.
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 . For example, in the below dialog, we have created a new calculated field 'Total Price' to determine the total product cost for a customer.
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.
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.
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.
Click the duplicate option to duplicate the datasets as shown below.
Replace Server Data Source
In the report designer, you have an option to replace the Server Data Source.
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.
Data Source will be 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.
Delete a Dataset: Removes the bound dataset from the report.
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.
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,
Using the ellipses button click the Replaceoption.
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.
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.
Revise the listed datasets and save the changes to start editing the report.
To View Report in case of Cache Dataset Errors
From Wyn release version V 7.1 onward, 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.
The report will now show an empty table instead of the errors.
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.
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.