Formula fields

Stimulsoft Reports.NET discussion
Post Reply
Wr00
Posts: 2
Joined: Sun Jun 11, 2006 4:31 am

Formula fields

Post by Wr00 »

Hi!

I need to know how to use the Formula fields(like we have in crystal). I mean how do I use the condition like if I have a field that returns True I need to display Yes instead of True. How do I do that here?

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

Formula fields

Post by Edward »

Please use the TextFormat property of the TextBox component:
Select the "Boolean" category in the "Formats" list
and in the Display property please type your text to output values for "False", "True", and "Null" values.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Formula fields

Post by Edward »

Please use the ternary expression in the following form:

{Condition ? Value1 : Value2}


if Condition returns true, then the expression will return the Value1, if Condition returns false then the expression will return Value2.

For example:

{Store.Count > 0 ? Store.Count : “Empty”}
Wr00
Posts: 2
Joined: Sun Jun 11, 2006 4:31 am

Formula fields

Post by Wr00 »


How i can do it in VB.Net?

Mark Smith
Posts: 37
Joined: Tue Jun 13, 2006 8:59 am
Location: Yorkshire, UK

Formula fields

Post by Mark Smith »

In VB.NET the (sort of) equivalent of the ? : operator is the IIF function.

Unfortunately this function is not a part of the VB.NET language so you need to add the Microsoft.VisualBasic.dll to your list of referenced assemblies and add Microsoft.VisualBasic to your list of NameSpaces.
Post Reply