Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
Hi guys,
I facing problem for sum the data in column of crystal report.
This is my code. @Discrate is the data from database. Its datatype is decimal.
{DataTable1.TotalPrice} is also from database. Its datatype is also decimal.
numbervar discrate :=ToNumber({@Discrate});
if discrate = 0.00 then
In my columns, I will display only data where @Discrate is 0.00.
So now my problem is how can I sum the {DataTable1.TotalPrice} Where @Discrate =0.00?
Posted 1-Jan-13 16:02pm
Des DC533

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Modify formula like this...
Global numbervar SumOfTtlPrice;
numbervar discrate := ToNumber({@Discrate});
if discrate = 0.00 then
    SumOfTtlPrice := SumOfTtlPrice + {DataTable1.TotalPrice};
dragdrop it in detail section

Now To print SumOfTtlPrice create another formula name it PrintSumOfTtlPrice
Global numbervar SumOfTtlPrice;
drag drop it in footer section
Happy Coding!
Smile | :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 358
1 Sergey Alexandrovich Kryukov 234
2 PhilLenoir 179
3 MT_ 175
4 Yogesh Kumar Tyagi 165
0 Sergey Alexandrovich Kryukov 6,205
1 OriginalGriff 5,333
2 CPallini 2,473
3 Richard MacCutchan 1,617
4 Abhinav S 1,530

Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100