Best way to print a report variable "Date" only if it is not Null

Stimulsoft Reports.NET discussion
Post Reply
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Best way to print a report variable "Date" only if it is not Null

Post by Fabio Pagano »

I have a report where i pass two report variables, "DateBegin" and "DateEnd" (these are the dates choosen by the user in my client interface). I want these two dates printed in the header in a format like "Dates choosen: from dd/mm/yy to dd/mm/yy", eg. "Dates choosen: from 01/05/08 to 12/05/08".

In the client interface the user can also not select any date: in this case the DateTime report variables are passed as NULL and obviously i don't want to print the whole string "Dates choosen:..."

How can i obtain this in design (not in code)? I've tried using Conditions (displaying the textbox only i date is not null) but without results, probably i'm missing something in the syntax.

Thanks.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Best way to print a report variable "Date" only if it is not Null

Post by Edward »

Please describe variables in the Dictionary as DateTime(Nullable) and in Conditions please write something like this:

(Variable1 == null)||(Variable2 == null)

also in Conditions please uncheck 'Component is enabled' checkbox.

If you need to print another text in the same textbox, then the checking may be made in the textbox directly:

{IIF((Variable1== null),"",Variable1.ToString())}

Thank you.
Post Reply