Hi everyone,
I'm working on a somewhat unusual report setup
current setup:
I have two working data sources:
1. A multi-level Nested Query
This retrieves structured data from MSSQL in the following hierarchy:
Recipe
└── Operation
└── Group
└── Step
It renders correctly in the report using Table Groups (parent/child/child) like:
- Operation 1
- Group 1
- Step 1 - value
- Group 2
- Step 1 - value
- Group 1
- Operation 2
- Group 1
- Step 1 - value
- Step 2 - value
- Step 3 - value
- Group 2
- Step 1 - value
- Group 1
So far, this is working great.
2. A script-based data source
This pulls a dataset from a different SQL database (external table) using a parameter like batch number.
This also works fine, but the result can only be displayed separately in the report. Using second table.
Now I want to insert the external table inline into the nested report, based on conditions found in specific steps.
For example:
- If a specific
IdStepValue = 300
I want to display the external table directly beneath that step.*
Operation 2
Group 1
Step 1 - value
Step 2 - [INSERT EXTERNAL TABLE HERE]
Step 3 - value
The external table structure is always consistent, and I know exactly where it should be inserted based on the values in a specific step. However, this external table cannot be joined directly into the existing nested query structure.
So my idea was to combine both data sources inside a scripting data source, manually transform everything into one unified nested dataset, and feed it to the report as a single source.
This would allow me to use child tables in a table group structure and conditionally embed the external table under the correct step.
I found this old post which shows how to build ReportQueryResults
/ ReportQueryRow
manually:
While I understand the principle, it looks fairly complex when dealing with multiple nested levels.
So my question would be:
- Is it realistically possible to do this cleanly via script (merging nested query + scripted external table)?
- Is there a recommended way to dynamically inject another table into a nested query layout?
- Is there any other way?
br,