Rounding for Decimal in crystal report - crystal-reports

I am currently trying to round up the figure in my crystal report but the round function in crystal report does not change it to correct figure.
Currently i am using crystal report 10.0.0.533
I am trying to convert 1192.04 to 1192.05 and 1192.07 to 1192.05.
Is this the default formula in crystal report or is there anyway i can change the formula?
Regards,
Ck

You cannot round 1192.04 to 1192.05. If you round it, the result will be 1192. 1192.07 will be rounded to 1192.1. Rounding is removing one or more signs after the decimal. In the new versions of Crystal you can create a function to handle this in the way you are describing it. However the only option in version 10 will be to create a UFL and add a function there.

Related

Round Function not working properly in crystal reports

Round() is not working properly in crystal reports. I have value 99.52865, I'm rounding the value to 4 decimal places by using Round function. The Function Displaying Value after rounding is 99.5286 but it has to round to 99.5287. For Some values it is rounding properly like 0.40465 to 0.4047. Facing issue for some values only.

Decimals are being rounded in crystal reports and computing incorrectly

Decimals are being rounded in crystal reports. The field(database field defined as float) Hours is being wrongly displayed in the crystal report. For example, 1.5 in the db is showing as 2.00, .75 shows as 1.00 and so on. There is also a field used to sum all the hours. That field is also picking the rounded values and summing incorrectly. I have formatted Hours as 1.00 and .01 in the formatting of crystal reports(for rounding & decimals). I also have the common tab(in format editor) as LN_Hours. Nothing seems to be working. I tried using x-2 formula with no luck.
Using crystal reports XI and SQL server MS 2012 and Visual studio 2003. Please throw some light on this situation! Thanks!
After a lot of trial and error , finally figured it out! The float from the database was being converted to decimal and being shown on the crystal report. Someone forgot to define the decimal places! Its all fixed up and running as expected. Thanks for all your suggestions.
In Crystal report
1. "Right Click" on the field and go to Format Field
2. In Format Editor go to Number Tab and then select from the different available decimal formats.
It may be rounding because of rounding decimal places

cdbl in crystal reports is giving wrong results in decimal points

Friends,
This is the formula in the crystal reports 9.
cdbl({nrconsolidated.collamt})/100000.000
nrconsolidated table is having 9 records.
in that one record's collamt value is 154250.
but in the crystal reports output its showing as 1.543 instead of 1.542.
i want only 3 decimal points.i dont know where the mistake is coming from?
in the crystal reports, i clicked on that collamt field and checked the data by seeing the browseData option...its showing as 154250.
how can i solve this issue? its showing the correct value in 4 decimal points but i want only 3 decimal points.
thanks
The below code will truncate the result after the calculation has been performed, and output it to 3 decimal places. This works for Crystal Syntax and should for Basic as well - I believe it is common amongst both.
truncate(cdbl({nrconsolidated.collamt})/100000.000,3)
On the field set the decimals 1.000 and rounding 0.001 will display what you want.

Creating an extra slice in pie chart in crystal report

I have a SQL which counts the number of rows. Say the result is 80.
I would like to have a parameter that is user-input, to be the total. Lets say the user enters 100.
How would I use the two numbers, 80 and 100, to create a pie chart that shows the data takes up 80% of the total?
I cannot find a way to add custom slice in a pie chart in Crystal Report, is it even possible?
Thanks!
Your best bet may be to stick your SQL in a stored procedure then pass the crystal parameter to the sproc to generate the "dummy" slice.
You can add multiple items to your chart.
Create a formula that calculates the difference between your measured value and your total. In your case this would be total_rows_entered_by_user - number_of_rows. Add the number of rows and the formula to the chart:

Display CR values as scientific notation

I have a series of very small positive and negative values stored in oracle which I am attempting to display in crystal reports. Crystal is displaying all the values as 0. However if I turn the max decimal places on I will see some values as 0.00...00XY.
I would like these values simply displayed as scientific notation with something like 1.2E-12.
It seems crystal automatically converts very large values to SN, but not very small values?
This is not possible so I went and created a view instead for each needed table. Kind of a dumb solution, but it seems the only way possible.