Variables and Expressions

Stimulsoft Reports.WPF discussion
Post Reply
RDR_Norkart
Posts: 46
Joined: Thu Jan 10, 2013 11:40 am

Variables and Expressions

Post by RDR_Norkart »

I have a table or Query in my report with these fields:
Name, Country, Ship

I create 2 Variables PickCountry and PickShip to show two comboboxes for Country and Ship.
The comboboxes show all the countries and all the ships in my table.
The filter-expressions look like this: (MyTable.Country == PickCountry)
So far so good… I can choose a Country and a Ship and the result in the report is Ok.

But now I only want to choose a Country and not a specific Ship.
Or.. a Ship and not a specific Country.

I could create 2 boolean Variables to show 2 Checkboxes: AllCountries and AllShips.
In my filter-expressions I would write something like this
(MyTable.Country == PickC ountry || AllCountries)
But this is not very userfriendly and what if I had 4 comboboxes. Then I also need 4 checkboxes.

So the question is:
Is it possible to add an Item “All countries” in my country-combobox. And what should I write in my filter-expression:
IIf PickCounty != “All countries” then MyTable.Country == PickCounty….??
Or… what with a checkbox as a part of a combox to enable and disable the combobox.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Variables and Expressions

Post by HighAley »

Hello.

One way is to add a record in your data source.
You could try to create a Form and put there Comboboxs and add item there.

Thank you.
Post Reply