Determine which component is targeted in ConnectDataSourceToData

Stimulsoft Reports.NET discussion
Post Reply
Vincent.L
Posts: 3
Joined: Wed Feb 21, 2024 8:53 am

Determine which component is targeted in ConnectDataSourceToData

Post 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 ?
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Determine which component is targeted in ConnectDataSourceToData

Post by Lech Kulikowski »

Hello,

You can use the RetrieveOnlyUsedData option for the report.

Thank you.
Vincent.L
Posts: 3
Joined: Wed Feb 21, 2024 8:53 am

Re: Determine which component is targeted in ConnectDataSourceToData

Post 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.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Determine which component is targeted in ConnectDataSourceToData

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply