Switch Case

Stimulsoft Reports.WPF discussion
mreddy@chessys.com
Posts: 3
Joined: Thu Feb 02, 2012 4:08 pm
Location: US

Switch Case

Post by mreddy@chessys.com »

Hi
Can any one please send me the syntax for switch case statement in stimulsoft. I was trying this and it never worked for me, Can any one correct me where I did wrong.

{Switch(holders.properties.currentreportingstatus == 0,'Unreported',
holders.properties.currentreportingstatus == 1,'Preliminary Reported',
holders.properties.currentreportingstatus == 2,'Preliminary Reported and Remitted',
holders.properties.currentreportingstatus == 3,'Final Reported and Remitted',
holders.properties.currentreportingstatus == 4,'Final Reported but not Remitted, i.e. Paid,Cancelled, or Deleted')}
























Attachments
1633.Img_Switch.png
1633.Img_Switch.png (59.69 KiB) Viewed 12636 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Switch Case

Post by HighAley »

Hello.
[quote="mreddy"@chessys.com]Hi
Can any one please send me the syntax for switch case statement in stimulsoft. I was trying this and it never worked for me, Can any one correct me where I did wrong.

{Switch(holders.properties.currentreportingstatus == 0,'Unreported',
holders.properties.currentreportingstatus == 1,'Preliminary Reported',
holders.properties.currentreportingstatus == 2,'Preliminary Reported and Remitted',
holders.properties.currentreportingstatus == 3,'Final Reported and Remitted',
holders.properties.currentreportingstatus == 4,'Final Reported but not Remitted, i.e. Paid,Cancelled, or Deleted')}[/quote]
You should use double quotation marks

Code: Select all

{Switch(holders.properties.currentreportingstatus == 0,"Unreported",
     holders.properties.currentreportingstatus == 1,"Preliminary Reported",
     holders.properties.currentreportingstatus == 2,"Preliminary Reported and Remitted",
     holders.properties.currentreportingstatus == 3,"Final Reported and Remitted",
     holders.properties.currentreportingstatus == 4,"Final Reported but not Remitted, i.e. Paid,Cancelled, or Deleted")}
Thank you.
d-hcelik
Posts: 68
Joined: Fri Sep 04, 2020 1:40 pm

Re: Switch Case

Post by d-hcelik »

Hi,I try same case but it give
that error:
Expression in Text property of 'Text20' can't be evaluated! Parser error: No overload for method 'Switch' takes '24' arguments

what is problem with this ?


{Switch(dtParametreler.param1 == "111","x -y",
dtParametreler.param1 == "132","a - b",
dtParametreler.param1 == "134","c",
dtParametreler.param1 == "321","d",
dtParametreler.param1 == "434","jjjjj",
dtParametreler.param1 == "444","woww",
dtParametreler.param1 == "666","yoyoy",
dtParametreler.param1 == "777","bbb",
dtParametreler.param1 == "788","ooo",
dtParametreler.param1 == "789","piuu",
dtParametreler.param1 == "900","heyyy",
dtParametreler.param1 == "901","Diğer")}
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Switch Case

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
d-hcelik
Posts: 68
Joined: Fri Sep 04, 2020 1:40 pm

Re: Switch Case

Post by d-hcelik »

This is dynamic report I can not preapere sample easily..Can you look my code are there any error?I just want use switch case in stimulsoft report

what is problem with this code?



{Switch(dtParametreler.param1 == "111","x -y",
dtParametreler.param1 == "132","a - b",
dtParametreler.param1 == "134","c",
dtParametreler.param1 == "321","d",
dtParametreler.param1 == "434","jjjjj",
dtParametreler.param1 == "444","woww",
dtParametreler.param1 == "666","yoyoy",
dtParametreler.param1 == "777","bbb",
dtParametreler.param1 == "788","ooo",
dtParametreler.param1 == "789","piuu",
dtParametreler.param1 == "900","heyyy",
dtParametreler.param1 == "901","Diğer")}


or

{Switch(dtParametreler.param1 == 1,"x -y",
dtParametreler.param1 == 2,"a - b",
dtParametreler.param1 == 3,"c",
dtParametreler.param1 == 4,"d",
dtParametreler.param1 == 5,"jjjjj",
dtParametreler.param1 == 6,"woww",
dtParametreler.param1 == 7,"yoyoy",
dtParametreler.param1 == 8,"bbb",
dtParametreler.param1 == 9,"ooo",
dtParametreler.param1 == 10,"piuu",
dtParametreler.param1 == 11,"heyyy",
dtParametreler.param1 == 12,"Diğer")}
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Switch Case

Post by Lech Kulikowski »

Hello,

At the current moment, is supported only 20 parameters in switch function, in your case is used 24. We have added a more parameters, it will be available in the next build.

Thank you.
d-hcelik
Posts: 68
Joined: Fri Sep 04, 2020 1:40 pm

Re: Switch Case

Post by d-hcelik »

Thank you,
when next build?
We will buy licence as company
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Switch Case

Post by Lech Kulikowski »

Hello,

Will be avaialable within several days in this week.

Thank you.
d-hcelik
Posts: 68
Joined: Fri Sep 04, 2020 1:40 pm

Re: Switch Case

Post by d-hcelik »

Hello
we bought and now use version 2020.4.2.0
does this support more parameters or should we wait?
thanks
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Switch Case

Post by Lech Kulikowski »

Hello,

Yes.

Thank you.
Post Reply