Crystal Report get sum error - visual-studio-2010

I watched video tutorial about Crystal Reports. I am confused because when I click Insert > Summary the Sum, Average and etc. are not on the list of Calculate this summary
I tried to search web but no luck. Please help me fixing this.

That would be because Crystal sees this field as a STRING and can't sum a string. You can write a formula field that will convert a string to a numeric and then do a summary of the formula:
Val ({YourTable.total})

#Icebergman_NewProgrammer, Your Sum field is a nvarcha/nchar or others.
plz check this and insure this int/decimal/numeric etc.

Related

SSRS 2012 total of a percentage measure

I have a percentage measure calculated in SSAS tabular and its correct.
But when i use it in a report i face the following problem (in all percentage measures).
the values under male and female (which are subgroup of saudi and non-saudi) are correct but if you look at the total under "Both sexes" it is incorrect,because it shows summation of male and female percentage, where the right thing is it shows the percentage of the saudi or non-saudi.
If i calculate the measure in SSRS in the expression fields i get it right as follows
But i want to use the measure to show the right values.
So.. can anyone help me with this i have serious issues in later reports and i just cant simply recalculate the SSAS measures in SSRS using expressions.
Note: dont mind the decimal places differences between the two pics.
Thank you.
You can change your MDX query in SSRS to return the subtotal rows then change your Textbox formulas in the body of the Report to say =Aggregate instead of =Sum. This process is described more here by Stacia. You can use manual MDX queries. Don't miss the comment at the bottom:
Romuald Coutaud March 17, 2011 at 7:52 pm Hi Stacia,
In fact, it works in query mode too in 2008R2. But, I have to admit
that the way that RS and AS work together when you want to use
aggregate function is very difficult to perfectly understand and I
have struggle very long time to make one sample report running in this
way. In query mode you need to write MDX by referencing each level of
the hierarchies from the top one to the deepest one want to display in
your report, even you don’t need to use all these ones. As an example
you have to put Year, Quarter and Month to be sure to display Month
and be able to use aggregate function.
Basically in your report =Aggregate will try to retrieve a row where Nationality is not null and Gender is null. If you get stuck please write back with the list of each field used in each group in SSRS and a screenshot of the MDX query designer.

What is summation for current group in rtf template?

I developed a oracle 10g BI Publisher report and having one issue. I am trying to sum value by current group but I am not getting correct results. Please help me.
<?sum(current-group()/DR[.!=''])?>
Ex: I have <?sum(current-group()/DR[.!=''])?> value is 19,234,770,654,698.34. I had sum with calculator each amount in this group is not equal to above result. Manual summation result is 19,234,770,654,698.33.
Although it is quite late, but hope you will find this answer useful as It worked for me. Replace TAN_AMT with your column name and place that in the appropriate place.
<?sum(current-group()/TAX_AMT)?> - <?sum(current-group()/TOTAL_AMT)?>

Browse field data shows value, but displays another value

I have a formula written for a field in Crystal Reports. When i refresh the report, i get a different value from the formula. The required value is always the last value in Browse Field Data dialog for that formula.
Isnt the formula supposed to have only one value as output? why are multiple values shown in browse field data dialog.? Is there a way to retrieve last value of Browse File Data dialog?
My formula looks like below:
WHILEREADINGRECORDS;
NumberVar CODTOTAL;
if {XXX.YYY} = 1 then
( CODTOTAL := CODTOTAL + {XXX.ZZZ};
);
CODTOTAL;
Browse field data shows all the values "CODTOTAL" acquires as a result of that formula and displays a random value amongst the assigned value.
Please help me out. I am amateur in crystal reports.
Any help would be highly appreciated.
~Regards.
First observation should be where have you placed the formula (Details, Footer.. etc).
why are multiple values shown in browse field data dialog.?
Browse field shows the data that is present in the table but in your case you are applying "If" condition of the filed. It can be possible that there is only one record that satisfies your condition.
I would suggest to run the report without the codition, Check the results and apply the condition and check results again.

Oracle spool Number rounding

I am calculating sum of all sales order (by multiplying quantity and price of a sales order - assume one sale order has only one item and using the sum function) in SQL query and I am spooling the output to a CSV file by using spool C:\scripts\output.csv.
The numeric output I get is truncated/rounded e.g. the SQL output 122393446 is made available in CSV as 122400000.
I tried to google and search on stackoverflow, but I could not get any hints about what can be done to prevent this.
Any clues?
Thanks
I think it is a xls issue.
Save as xls.
format column -> number with 2 decimals for example.
Initially I thought it might have something to do with the width of the number format which normally is 10 (NUMWIDTH) in sqlplus, but your result numeric width is 9, so that can not be the problem. Please check your query if you use a numeric type that doesn't have the required precission, and thus makes inexact calculations.

How to get average of a column in terms of another column?

How to get average of a column in terms of another column and put this value in a third column, and this value will be evaluated for each retrieved record?
"How to perform an opertaion on two columns in a report and insert the result in a third column?"
FYI: I'm using CrystalReport Designer embedded with VisualStudio.NET 2005.
First you need to create formula (with content like "{table.commission}/{table.fare}*100"). I hope next MSDN link will help you (I personally have never used embedded variant of CRD):
Crystal Reports Basic for Visual Studio
Formula Overview

Resources