Solved

I have problem when I sum two columns  or  more on a CrystalReport

Posted on 2008-10-25
15
288 Views
Last Modified: 2012-06-27
I added a formula field

And I added this equation

formula = {Data_Emb.Sal}+{Data_Emb.Recompense1}

note 1 :

Recompense1 column was text
but I changed it to Number
but no working

when I added this equation

formula = {Data_Emb.Sal}+{Data_Emb.ID}

It's OK

I think because ID column was Number and still  Number

note 2:
when I make (Main Report Preview)
it's work Ok

2222111.jpg
0
Comment
Question by:SystemSys
  • 7
  • 4
  • 4
15 Comments
 

Author Comment

by:SystemSys
ID: 22802302
note 3:
when I change column  in database from Recompense1 to Recompense1_1
it's  also work Ok

0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 22802874
Try this:

formula = {Data_Emb.Sal}+val({Data_Emb.Recompense1})

I am pretty sure that CR has a Val Function to convert Text to Numbers

0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 22802878
but that leads to the question, if Recompense1 is always going to hold numbers, why is the field declared as a Text?

AW
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 100

Expert Comment

by:mlmcc
ID: 22803156
When you changed the field to a number did you VERIFY THE DATABASE?
Crystal reads the database when you first build the report but doesn't see the changes until you force it to with the Verify Database under the DARABASE menu

mlmcc
0
 

Author Comment

by:SystemSys
ID: 22803868

Thanks Arthur_Wood and mlmcc for help me
I tried
formula = {Data_Emb.Sal}+val({Data_Emb.Recompense1})
but this message
A string is required here

===={  but that leads to the question, if Recompense1 is always going to hold numbers, why is the field declared as a Text? }====
you are right
for this I changed it to Number

========================

mlmcc:

I changed after I made first build to the report
I think the report still  keep  Recompense1's type

not 4 :
I removed the column Recompense1
after that I made now column as a Number
Name is Recompense1
but don't work

not 5 :
I becoming crazy



2566.png
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22804527
Have you VERIFY DATABASE?

mlmcc
0
 

Author Comment

by:SystemSys
ID: 22804568
Thanks mlmcc for interest to me

Sorry, I'm not sure what do you mean by VERIFY DATABASE

you can clearing more to me?
0
 

Author Comment

by:SystemSys
ID: 22804618
I use ADO.NET DataSets (DataSet1.xsd) to filling CrystalReport
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22804918
When you edit the report, Click DATABASE --> VERIFY DATABASE

mlmcc
0
 

Author Comment

by:SystemSys
ID: 22806179
Yes I had VERIFY DATABASE
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22806209
What is the formula now?

WHat error are you getting?

mlmcc
0
 

Author Comment

by:SystemSys
ID: 22806243

When I Click  VERIFY DATABASE
I get this message:
The database is up to date
But No new, it's like before
 
0
 

Author Comment

by:SystemSys
ID: 22810226

I changed I change column Name In the Database

it's work

But I wanted know what is my mistake  :(

because that incorrect answer
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 500 total points
ID: 22811386
"Thanks Arthur_Wood and mlmcc for help me
I tried
formula = {Data_Emb.Sal}+val({Data_Emb.Recompense1})
but this message
A string is required here "
 
The error message was because you had now changed the Recompense1 field to NUMBER, and the val function only acts on String fields.  You made both changes, when either one or the other was necessary, but not both, together.
 
AW
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 22811396
I ponted him the the right direction, but he made TWO changes, which collided.  One or the other of the two changes he made would have been sufficient, but both were overkill.
AW
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question