Page 1 of 1

Setting condition in groupheader from code-behind

Posted: Fri Oct 21, 2011 4:29 am
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.

Setting condition in groupheader from code-behind

Posted: Fri Oct 21, 2011 5:51 am
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.

Setting condition in groupheader from code-behind

Posted: Fri Oct 21, 2011 8:05 am
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.

Setting condition in groupheader from code-behind

Posted: Fri Oct 21, 2011 8:21 am
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:

Setting condition in groupheader from code-behind

Posted: Fri Oct 21, 2011 8:40 am
by Alex K.
Hello,

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

Thank you.