I've been having this problem for quite a while and I couldn't get to find a decent fix for it. Here is the thing: all the reports are embedded in a Vb.NET solution and every time I set a value for a report parameter (happens with the first one only if there are multiple parameters), the application hangs for about 15 seconds. Oddly enough, 15 seconds is the connection timeout for my datasource.
Here is the structure of my report:
Here is an example of what I do:
Dim l_rpt As ReportClass = New MyEmbeddedReport
*The system hangs for ~15 secs then goes on*
*Then I set the data sources because the database location in the production environment cannot be predicted*
For Each fe_con As IConnectionInfo In l_rpt.DataSourceConnections
For Each fe_sub As ReportDocument In l_rpt.Subreports
For Each fe_subconn As IConnectionInfo In fe_sub.DataSourceConnections
I know this hang is caused by the report looking for a data source which does not exist anymore, so that's why I thought I'd set the data source programmatically BEFORE setting the parameters. That did not work since the hang was now caused by accessing the l_rpt.Subreports property. I believe listing the subreports cause the report to check the subreports' datasources, the same way SetParameterValue does.
So I'm stuck in a dead end: I cannot define the data source directly in the .rpt file since it is bound to change and I cannot set it programmatically because it causes a ridiculous load delay. Does anyone have a brilliant idea on how to fix this?