Click here to Skip to main content
11,645,033 members (63,516 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi all,
I doing a project regarding crystal report.
I need to make some calculation of the total product.
Consignment_Sales_Report.SuppMargin is the amount I want to sum.
But when I click save, it come out a message say that "A number field or currency number field is required here."
Can anyone help me? Where is my wrong?
Or anyone can provide me some useful link for reference?
Below is my code.
Sum ({Consignment_Sales_Report.SuppMargin} )
Posted 23-Dec-12 13:54pm
JOE MIS2.4K
Edited 23-Dec-12 15:16pm
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

To declare a local variable using crystal sintaxe :
Local NumberVar x := Sum ({Consignment_Sales_Report.SuppMargin} );

best regards
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

make sure,
Consignment_Sales_Report.SuppMargin
is number field. it should not be string or any other type of column

Other way is...
sum( ToNumber({Consignment_Sales_Report.SuppMargin}) )

Happy Coding!
Smile | :)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Dear all,
I tried code as shown below.
but still get the same error.

local numbervar x :=sum(ToNumber({Consignment_Sales_Report.Quantity}));
sum(ToNumber({Consignment_Sales_Report.Quantity}));
local numbervar x :=sum({Consignment_Sales_Report.Quantity});
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

if my variable isn't number,is it will affect this error happened?
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 725
1 jyo.net 494
2 Sergey Alexandrovich Kryukov 464
3 Afzaal Ahmad Zeeshan 404
4 CPallini 386
0 OriginalGriff 1,065
1 Sergey Alexandrovich Kryukov 683
2 DamithSL 681
3 Afzaal Ahmad Zeeshan 662
4 CPallini 555


Advertise | Privacy | Mobile
Web02 | 2.8.150731.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2015
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