Page 1 of 1
How to create formula in stimulsoft
Posted: Sun Jan 08, 2012 7:57 am
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
How to create formula in stimulsoft
Posted: Mon Jan 09, 2012 8:25 am
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.
How to create formula in stimulsoft
Posted: Mon Jan 09, 2012 8:41 am
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....
How to create formula in stimulsoft
Posted: Tue Jan 10, 2012 2:28 am
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.
How to create formula in stimulsoft
Posted: Tue Jan 10, 2012 7:11 am
by Kennedy
Thank you...
Do stimulsoft have any syntax help like crystal report??
How to create formula in stimulsoft
Posted: Tue Jan 10, 2012 8:56 am
by Alex K.
Hello,
For most functions you can find description in dictionary.
Thank you.