Page 1 of 1

SubReport with DataBand Parameters

Posted: Fri Feb 10, 2017 12:09 pm
by pcsiquiero
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:

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

Re: SubReport with DataBand Parameters

Posted: Mon Feb 13, 2017 7:53 am
by Alex K.
Hello,

You can use the ReconnectOnEachRow property for the detail data source.
Please check the sample report in the attachment.

Thank you.

Re: SubReport with DataBand Parameters

Posted: Mon Feb 13, 2017 10:45 am
by pcsiquiero
It worked. Thanks.

Re: SubReport with DataBand Parameters

Posted: Mon Feb 13, 2017 2:03 pm
by Alex K.
Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.