SubReport with DataBand Parameters
Posted: Fri Feb 10, 2017 12:09 pm
I have a main query being listed in the report using the DataBand.
Within the DataBand I include a SubReport to display records of a secondary query with values related to each current record of the DataBand, but I am not able to understand how to pass to the SubReport query the values of the current record of the main query that should be used in the "where" clause of the secondary query.
Example of my two queries:
Within the DataBand I include a SubReport to display records of a secondary query with values related to each current record of the DataBand, but I am not able to understand how to pass to the SubReport query the values of the current record of the main query that should be used in the "where" clause of the secondary query.
Example of my two queries:
Code: Select all
-- Main query
SELECT
typeRegister,
yearRegister,
numberRegister,
(...other columns)
FROM
myMainTable
WHERE
(... conditions)
-- For each main query record, I need to list records from a second query using as conditions from that second query, columns from the first query.
SELECT
column1,
column2,
column3,
(... other columns)
FROM
mySecondaryTable
WHERE
typeRegister = @typeRegister -- Value of the current record of the first query
AND yearRegister = @yearRegister -- Value of the current record of the first query
AND numberRegister = @numberRegister -- Value of the current record of the first query