Filtering question (newbie)

Stimulsoft Reports.NET discussion
Post Reply
Liem
Posts: 3
Joined: Wed Dec 09, 2009 8:48 am
Location: Vianen, Holland

Filtering question (newbie)

Post by Liem »

Hello from Holland,
I'm trying to filter out rows from my report when some criterion is false. The filter itself works OK, but I cannot figure out how to make the row completely invisible.
One component on the row is {Product.description}: In a valid row this would be rendered as e.g. "Pickup rate:" When the rate is 0 I don't want to see the row at all, but in my report I still see ":". How do I make the row completely invisible?
The filter is set on the data band, by r-clicking on the band header in the report designer, and choosing Design... and then Filters.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Filtering question (newbie)

Post by Edward »

Hi

Please show the filter expression you set in the DataBand's Filter.

Thank you.
Liem
Posts: 3
Joined: Wed Dec 09, 2009 8:48 am
Location: Vianen, Holland

Filtering question (newbie)

Post by Liem »

Hi Edward,
The last expression filter I tried was

Code: Select all

!Product.OrderRegel.TotaalBedrag.ToString("N2").Equals("0,00")
but I also tried a value filter "Numeric Value Orderregel.TotaalBedrag greater than 0".

As I mentioned before, I think that the filtering action itself works. What it does surprises me.
There are three items/columns in the band:
{Product.Description}:
{Product.OrderRegel.Number} x € {Product.OrderRegel.Price.ToString("N2")} =
€ {Product.OrderRegel.TotaalBedrag.ToString("N2")}

When the total price is > 0 all is well. When total price is 0 and I don't want to see this line, I get
: 0 x € 0,00 =

I set the property Hide Zeros to True for all three items.

Strange thing: when I use the filter expression "false", nothing is shown in the data band. So filtering out all lines works, but not filtering out 1 line...

Thanks for your help!
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Filtering question (newbie)

Post by Edward »

Hi

If you need to make a StiText component to shrink automatically to zero height, then it must contain no symbols at all. You can hide ':' symbol as follows:

{String.IsNullOrEmpty(Product.Description)?"":":"}
or as follows:
{IsNull(Product,"Description")?"":":"}

To filter out all values you also should be careful to cast numeric values to string as regional settings will be applied to values.

So the following form is more acceptable:

Product.OrderRegel.TotaalBedrag != 0m

Thank you.
Liem
Posts: 3
Joined: Wed Dec 09, 2009 8:48 am
Location: Vianen, Holland

Filtering question (newbie)

Post by Liem »

Thank you very much! This was exactly the info I needed.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Filtering question (newbie)

Post by Edward »

Hi

You are very welcome :)

Please let us know if any help is required.

Thank you.
Post Reply