Dynamic GroupHeaderBand

Stimulsoft Ultimate discussion
Post Reply
mahsan
Posts: 15
Joined: Tue Feb 16, 2016 1:08 pm

Dynamic GroupHeaderBand

Post by mahsan »

Hello
I want To set the condiontion of GroupHeaderBand dynamicly,for example when I Check the ChkBox1 ,the groupBand set group by
Column1 ,when I Check the ChkBox2 ,the groupBand set group by Column2
Is it Possible to do this?
I am Waitting eagerly for your response.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Re: Dynamic GroupHeaderBand

Post by Jan »

Hello,

You can use following expression in group condition:

Code: Select all

{checkbox1 ? datasource.name1 : datasource.name2}
or

Code: Select all

{checkbox1 ? datasource.name1 : (checkbox2 ? datasource.name2 : datasource.name3)}
Thank you.
mahsan
Posts: 15
Joined: Tue Feb 16, 2016 1:08 pm

Re: Dynamic GroupHeaderBand

Post by mahsan »

Thank You very much.
Is it possible to write this code on Click a button In Form?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamic GroupHeaderBand

Post by HighAley »

Hello.

No, could you specify what do you want to do?

Thank you.
mahsan
Posts: 15
Joined: Tue Feb 16, 2016 1:08 pm

Re: Dynamic GroupHeaderBand

Post by mahsan »

I have a groupheaderband in my report ,and there is a form with 3 radiobuttons,if User select first radiobutton the I want the report to be grouped by City ,if user select second rediobutton I want the report to be grouped by Street and if user select third rediobutton I want the report to be grouped by Country.so I need a dynamic groupheader band
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Dynamic GroupHeaderBand

Post by Alex K. »

Hello,

Please try to use the following expression:

Code: Select all

{RadioButtonControl1.Checked ? datasource.name1 : (RadioButtonControl2.Checked ? datasource.name2 : datasource.name3)}
Thank you.
mahsan
Posts: 15
Joined: Tue Feb 16, 2016 1:08 pm

Re: Dynamic GroupHeaderBand

Post by mahsan »

Thank You for Your response,But I want set the groupexpression on OnClick a button in the report form
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamic GroupHeaderBand

Post by HighAley »

Hello.

Sorry, there is no other way to do this.
Please, set the value of a variable and then use it in the Condition expression like above.

Thank you.
mahsan
Posts: 15
Joined: Tue Feb 16, 2016 1:08 pm

Re: Dynamic GroupHeaderBand

Post by mahsan »

excuse me how can I do it with varriable ?
I create a varriable "Vargrp" as string and set the value of it with "Dt.AccCode".
and write this code below on GoupCondition in my GroupHeaderBand
------------
StiGroupConditionExpression s = new StiGroupConditionExpression();
s.Value= {Vargrp};
GrpHeader.Condition =s;

-------------
but it dosent work.please help me to solve my problem.Thanks you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Dynamic GroupHeaderBand

Post by Alex K. »

Hello,

Please send us a sample which reproduces the issue for analysis.

Thank you.
Post Reply