Solved

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

Posted on 2008-10-25
15
289 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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