Solved

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

Posted on 2008-10-25
15
285 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now