Click here to Skip to main content
13,045,564 members (72,952 online)
Rate this:
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...
[__u__]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!

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2017
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