Get component of StiDataBand

Stimulsoft Reports.NET discussion
Post Reply
commit.sim
Posts: 10
Joined: Thu Jan 19, 2023 10:01 am

Get component of StiDataBand

Post by commit.sim »

Hi,
for getting all report component, programmatically, i can using this tecnique:
//good code
var components = Report.GetComponents().ToList();
but, I would need to get all the components inside specific StiDataBound. Something like this:
//broken code
var components = Report.GetComponentByName("DataBand1").GetComponents().ToList()
How do you get this? Thanks in advice.
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Get component of StiDataBand

Post by Lech Kulikowski »

Hello,

You can use the following code:

Code: Select all

var databand = report.GetComponentByName("DataBand1") as StiDataBand;
var componentsOnBand = databand.GetComponents();
Thank you.
commit.sim
Posts: 10
Joined: Thu Jan 19, 2023 10:01 am

Re: Get component of StiDataBand

Post by commit.sim »

Easily casting it... sorry for my newbie.

Thank you :)
Max Shamanov
Posts: 786
Joined: Tue Sep 07, 2021 10:11 am

Re: Get component of StiDataBand

Post by Max Shamanov »

Hello,

You are Welcome!
Post Reply