Page 1 of 1

Sending connection string to subreport?

Posted: Tue Feb 10, 2026 8:35 am
by DavidLee82
I have put together a report that has an embedded subreport. Can I know how do I pass the connection string from my main report to the subreport? At the moment the subreport is using a hardwired connection string which works but I'd like to be able to control the subreport's connection strings as well if possible.

Thanks.

Re: Sending connection string to subreport?

Posted: Tue Feb 10, 2026 10:48 am
by Lech Kulikowski
Hello,

How do you want to provide a connection string to the subreport? From the code of your app?

Thank you.

Re: Sending connection string to subreport?

Posted: Wed Feb 11, 2026 12:41 am
by DavidLee82
Hi,

I would like the connection string be propagated from the main report to the subreport if that's possible. The main report already receives the connection string from my app during the rendering phase, and the main report is supposed to invoke the subreport for each group of items.

(This is largely related to the report with the crosstab/table we discussed last year, we have recently found that the crosstab is for some reason not able to be used together with groups and the workaround we devised was to use it as a subreport invoked for each group in the main report).

Re: Sending connection string to subreport?

Posted: Wed Feb 11, 2026 9:43 pm
by Lech Kulikowski
Hello,

If your subreport is embedded, then it shares the same dictionary as the main report, and you can set the connection string from code.
If it is external, then you can load it and change the connection string directly in the Subreport.

Thank you.

Re: Sending connection string to subreport?

Posted: Thu Feb 12, 2026 12:41 am
by DavidLee82
Hi,

Can you provide sample code on how to do that? The subreport is embedded, but as a resource instead of a subreport.

Edit: Attached is a copy of the report with the connection strings removed. Also attached is the SQL function used by the subreport to generate it's matrix.

Edit2: Forgot to attach a function that the matrix function is dependent on.

Re: Sending connection string to subreport?

Posted: Fri Feb 13, 2026 9:43 pm
by Lech Kulikowski
Hello,

We need some additional time to investigate the issue, we will let you know about the result as soon as possible.

Thank you.