How to create formula in stimulsoft

Stimulsoft Reports.NET discussion
Post Reply
Kennedy
Posts: 7
Joined: Sun Jan 08, 2012 7:48 am

How to create formula in stimulsoft

Post by Kennedy »

I want to create a formula for displaying total work hours.

I have two DateTime fields,
ActualIn and ActualOut
If IsNull(ActulOut)
then
'0'
else

Total={DateDiff(AttendLog.ActualOut ,AttendLog.ActualIn)}

Please help me to achieve this.

In crystal report , i can do this,
But in stimulsoft,when i try to achieve this, the entire formula text is displaying.

Thanks in advance
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to create formula in stimulsoft

Post by Alex K. »

Hello,

You can use the following expression in Text component:

Code: Select all

{(AttendLog.ActulOut == null ? "0" : DateDiff(AttendLog.ActualOut ,AttendLog.ActualIn).ToString())}
Thank you.
Kennedy
Posts: 7
Joined: Sun Jan 08, 2012 7:48 am

How to create formula in stimulsoft

Post by Kennedy »

Thank you.............

Let me know one thing ,what about the syntax for if ..else in stimulsoft.net
As your post it is working,but iwant to include one more condition,
if(AttendLog.ActualIn==null) then '0'

i tried in this way
{(AttendLog.ActulOut == null ? "0" :AttendLog.ActulIn == null ? "0": DateDiff(AttendLog.ActualOut ,AttendLog.ActualIn).ToString())}

But it is not giving the expected result.

Thanks in advance....
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to create formula in stimulsoft

Post by Alex K. »

Hello,

Also you can use function IIF() in expression:

Code: Select all

object  IIF (bool condition, object truePart, object falsePart)
Thank you.
Kennedy
Posts: 7
Joined: Sun Jan 08, 2012 7:48 am

How to create formula in stimulsoft

Post by Kennedy »

Thank you...
Do stimulsoft have any syntax help like crystal report??
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to create formula in stimulsoft

Post by Alex K. »

Hello,

For most functions you can find description in dictionary.

Thank you.
Attachments
1561.Capture.PNG
1561.Capture.PNG (24.04 KiB) Viewed 4562 times
Post Reply