Page 1 of 1

What controls the order the datasources execute

Posted: Fri Dec 01, 2023 4:44 pm
by RickSharpe
Hello,
I have a report with 4 datasources for a dictionary. I see the order they are displayed in the Designer UI and iterating through the datasources in code using:
foreach (StiSqlSource curDatasource in report.Dictionary.DataSources)
{
System.Diagnostics.Trace.WriteLine("SQL Datasource Name: " + curDatasource.Name );
}
produces these trace statements:
SQL Datasource Name: ProposalData
SQL Datasource Name: CompanyLogoQuery
SQL Datasource Name: _AppRole1Copy
SQL Datasource Name: JobHeaderConditions

However, monitoring the request to the SQL Server I can tell that these request/statements are not executed in this order.
What determines the order the datasources are executed?
Is there a way to control which source executes first?

Re: What controls the order the datasources execute

Posted: Mon Dec 04, 2023 11:52 pm
by Lech Kulikowski
Hello,

It should connect in order as its stored in the Dictionary.

What product and version are you use? How do you run your reports?

Thank you.

Re: What controls the order the datasources execute

Posted: Tue Dec 05, 2023 7:16 pm
by RickSharpe
Hi Lech,

I'm using Stimulsoft Report.Net 2023.3.1.
The basics of my calls are:

Report.Load(fileName);
foreach (StiDatabase curDatabase in report.Dictionary.Databases)
{
((StiSqlDatabase)curDatabase).ConnectionString = connectionString;
}
Report.Show(true);

Watching with SQL Profiler I can see that the data sets are executing in this order:

_AppRole1Copy
JobHeaderConditions
ProposalData
CompanyLogoQuery

You can see in this image the datasets shown in the designer. The order there matches the order from the loop through the datasets I posted originally.
https://workdrive.sharpesoft.com/extern ... 461354dcc8

Re: What controls the order the datasources execute

Posted: Tue Dec 05, 2023 9:42 pm
by Lech Kulikowski
Hello,

Please send your report template for analysis.

Thank you.