Setting condition in groupheader from code-behind

Stimulsoft Reports.WEB discussion
Post Reply
shilpa
Posts: 21
Joined: Thu Aug 11, 2011 8:03 am
Location: India

Setting condition in groupheader from code-behind

Post by shilpa »

Hi,

I am using stimulsoft reports in my project.I have one requirement in my report to pass one value from code-behind to the report.And to use that value in the condition of groupheader band.

Im not able to find any solution for this.Kindly assist me.

Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Setting condition in groupheader from code-behind

Post by Alex K. »

Hello,

As a way, you can use the following code:

Code: Select all

StiGroupHeaderBand groupBand = report.GetComponents()["GroupHeaderBand1"] as StiGroupHeaderBand;
groupBand.Condition = new StiGroupConditionExpression("YourConditions");
Thank you.
shilpa
Posts: 21
Joined: Thu Aug 11, 2011 8:03 am
Location: India

Setting condition in groupheader from code-behind

Post by shilpa »

Hi

Thanks for the prompt reply.

I used the coding given by u.It is as below -

Dim groupBand As New StiGroupHeaderBand
groupBand = ssoftRpt.GetComponents("GroupHeaderBand1")
groupBand.Condition.Value = "some value" - which i want in my mrt file.

But, this value is not reflecting in the mrt file.It is not getting passed to the condition value of groupheaderband.

Kindly suggest solution for this.

Thanks you.
shilpa
Posts: 21
Joined: Thu Aug 11, 2011 8:03 am
Location: India

Setting condition in groupheader from code-behind

Post by shilpa »

Hi,

After writing to u,I used the coding given by u as shown below after loading of report & before compiling of report.

Dim groupBand As New StiGroupHeaderBand
groupBand = ssoftRpt.GetComponents("GroupHeaderBand1")
groupBand.Condition.Value = (some value given by me)

And, I could see the results.Thank u very much for your assistance.

Cheers.
:biggrin:
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Setting condition in groupheader from code-behind

Post by Alex K. »

Hello,

Ok.
Let us know if you need any additional help.

Thank you.
Post Reply