Print Page | Close Window

No sum possible for numeric-columns

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=11791
Printed Date: 04 May 2024 at 4:55am


Topic: No sum possible for numeric-columns
Posted By: gipsy
Subject: No sum possible for numeric-columns
Date Posted: 06 Dec 2010 at 4:02am
Dear all

i have a problem by using crystal report. My target: creating a report with a sum for every group and a diagram wich visualizes all sums.

=> From the connected table, I want to use 2 columns

1sth. street classes (Group) => datatype varchar
2nd. street length => datatype number

There no possibility to sum the length for every street group (not inside the assistants and not inside the report). Furthermore I can not do any group-settings inside the diagram-assistant.
Still crystal reports closes directly after 5 seconds when I start to open it - so I can only work when I use already generated rpt-files. SP2 is installed on my pc.

OK, I am a newbee with crystal reports - but my crystal (Version 2008) works not like tutorials told me. Can you help me?

best regards

Thomas



Replies:
Posted By: lockwelle
Date Posted: 06 Dec 2010 at 4:07am
Sorry, I'm a bit confused.  What do you mean that you can't sum street length?  It should be available for the group, and if not there you can always create you own running totals (probably a Crystal Reports running total as well, that's DBlanks forte).
 
I don't know anything about a diagram assistant, but you should be able to sum for the report.


Posted By: gipsy
Date Posted: 06 Dec 2010 at 7:13am
I mean, that there is no chance to get the sum for my numeric column. When I act inside the blank report like 

insert => groupresult => choose the numeric column => there is no sum inside the pulldown-menu. There is only something like highest value, lowest value,....but no sum. Not on this way and not when I do want to do this with a report-assistant. The tutorials told me that the sum should be created autmatically when I use the an assistant to create a report and build a group.


Posted By: lockwelle
Date Posted: 06 Dec 2010 at 8:56am
it sounds like the report does not think that your length is a number...that sounds like what it displays for strings.  When you hover over the field, what data type does CR report it as?


Posted By: gipsy
Date Posted: 06 Dec 2010 at 8:25pm
Yes, I think you are right.

In our database, length is a number and crystal reports tells me that it is a string.
Other case: a column from our database (VarChar(10 Byte)) is in crystal a number and crystal tells me that I can get the sum for this attribute.

What can I do now?


Posted By: Keikoku
Date Posted: 07 Dec 2010 at 3:14am
Does it work if you convert the length to a number first and hoping CR is smart enough to figure out that you did a type conversion?

I mean, I guess an option besides using their summary features is to write a formula that will take the sum.

But as I'm not familiar with the things you mentioned in your situation I don't know exactly what you can or cannot do.


Posted By: lockwelle
Date Posted: 07 Dec 2010 at 3:31am
That's not making much sense.  If Crystal is allowing a sum on a varchar field...something is not right.  I would try refreshing the database, that might correct the issue.
 
Is the report joined directly to the tables or to a stored proc.  I can see this happening if you push the data to the report, but have misidentified the schema.
 
I would try the refresh and see if that helps.


Posted By: gipsy
Date Posted: 07 Dec 2010 at 11:06pm
Keikokus solution tonumber-conversion was great. Now, I can get the sum for every group! Thanks!

But how is it possible to get the overall-result? Crystal told me that I can't use sum() for my group-sums.

best regards



Posted By: Keikoku
Date Posted: 08 Dec 2010 at 4:32am
Are you able to create a running total that will take the sum of the lengths evaluated by group?



Print Page | Close Window