Solved

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

Posted on 2008-10-25
15
290 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

690 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