Page 1 of 1

Determine which component is targeted in ConnectDataSourceToData

Posted: Wed Feb 21, 2024 3:32 pm
by Vincent.L
Hello !

I implement Stimulsoft Designer into our solution and give it access to a custom data source.

So I implemented Custom StiDataAdapterService with specific StiDatabase and StiDataSource.
My question concerns the ConnectDataSourceToData method which is poorly documented.

I have determined that this method is called for each data source for each component.
My problem is determining which component is targeted for a specific call.

Right now I'm iterating over each dictionary.Report.GetComponents() and skipping the ones where Component.Page != Report.CurrentPage.
The problem is that in a single page there can be multiple components targeting the same Datasources but with different required columns and/or filters which have a serious impact on performance.

Could you please help le ?

Re: Determine which component is targeted in ConnectDataSourceToData

Posted: Wed Feb 21, 2024 11:16 pm
by Lech Kulikowski
Hello,

You can use the RetrieveOnlyUsedData option for the report.

Thank you.

Re: Determine which component is targeted in ConnectDataSourceToData

Posted: Thu Feb 22, 2024 7:27 pm
by Vincent.L
Hello,

Thank you for your answer, but I do not understand how it is supposed to respond to my probleme.

In my case, I implemented my own request builder and determine myself whitch data are required in the report so the RetrieveOnlyUsedData option seems not to be applicable in my context.
Enabling this option has no impact on the amount of ConnectDataSourceToData calls.

The only thing i am seeking for is how to determine whitch component is targeter by current call in the ConnectDataSourceToData method himself.

Re: Determine which component is targeted in ConnectDataSourceToData

Posted: Mon Feb 26, 2024 9:21 pm
by Lech Kulikowski
Hello,

The data connection is called before the report is rendered, not a specific component.

Thank you.