?
Solved

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

Posted on 2008-10-25
15
Medium Priority
?
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 
LVL 101

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 101

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 101

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 101

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 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

764 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