How to Enable Multiple Dataset Assignment in the Bold Reports Embedded Designer
Enable enableTableMultipleDataAssign in the embedded Report Designer to assign fields from more than one dataset to table cells. This is useful when a report needs to present related values from separate data sources together without building a separate subreport. The table can display values from different datasets, but it does not join or align their rows automatically.
Step-by-Step Instructions
Step 1: Configure the Designer Property
Set enableTableMultipleDataAssign to true when initializing the Report Designer:
<script type="text/javascript">
$(function () {
$("#designer").boldReportDesigner({
// Replace with your actual service URL
serviceUrl: "https://demos.boldreports.com/services/api/ReportingAPI",
// Enable the option for multiple dataset assignment
enableTableMultipleDataAssign: true
});
});
</script>
| Property Name | Description |
|---|---|
enableTableMultipleDataAssign |
Enables the table report item to accept fields from multiple datasets when set to true. |
Step 2: Assign Fields from Multiple Datasets
-
Create or open a report that contains two or more datasets.
-
Drag a Table report item onto the design surface.
-
Drag a field from DataSet1 into the first column.
-
Drag a field from DataSet2 into the second column.
-
Drag a field from DataSet3 into the third column.
The table’s rows are driven by its assigned dataset; assigning a field from another dataset does not join that dataset’s rows to the table. To show a related value from another dataset, use an expression such as Lookup with matching key fields, or aggregate the secondary dataset as appropriate. For example:
=Lookup(Fields!DepartmentID.Value, Fields!ID.Value, Fields!Name.Value, "DataSet2")
This example looks up a matching department name in DataSet2. Replace the key fields, return field, and dataset name to match your data. See Combine Data from Multiple Datasets Using the Lookup Function for a step-by-step Lookup example.
The exact expression generated when a field from a secondary dataset is dragged into a table depends on the designer behavior. Inspect the cell expression and confirm it returns the intended value; do not assume rows from the datasets are automatically joined or aligned.
Download the sample application here.