Decimals dont show and adds 000 - crystal-reports

I have a string filed in my crystal report with a value of 696 000.00. But I want to be displayed as 6,960,00 in my report. I am using below formula but that's not working. Any ideas?
the Normal value befor I add the formua is 6960.
ToText( ToNumber({Fakturalinje.ItemDescription2}))

You have 2 ways...
One right click on the field and go to format and select required option.
Second way
ToText({Fakturalinje.ItemDescription2},'#')
Format window will be like this.

Related

How to use a formular to set different number of significant figures in crystal reports

I have different products using the same report and the difference between all of them is the number of significant figures that each use for the calculated results.
I know that you can set the number of significant figures in crystal for a numeric field, so what I want to do is set this ON CONDITION.
The idea I have is to use an IF statement like this: IF Product_Name = '...' set ?? . So my question is what do I set there?
Select the Product Field
Right Click
Click on Format Object
Click Number
Click Customize
Click on Formula Editor Button in front of Decimals
Enter the following formula
if {ProductName}="Product Name 1" then 1
else if {ProductName}="Product Name 2" then 2
else 3
This should help

removing decimals in crystal reports for number field

I have a field year which is string type coming from db side.So I converted that to number and adding 1 more year to that to show like this:
Year:2014-2015
Below is the formula.
'Year' & ':' & tonumber({FocusOnCustomer.YEAR})&'-'&(tonumber({FocusOnCustomer.YEAR})+1)
Everything is working fine in designer.But when I view the report in cr viewer I am getting data like this.
2,014.00-2,015.00
I want to remove decimals and comas
Try:
ToText( ToNumber({FocusOnCustomer.YEAR}), "#")
Right-click on the field or formula
Select Format Field
On the Number tab, choose the format to use from the list or click Customize to create a custom format.
Click OK
Website Link

New line return in Crystal Report

Im creating a report based on crystal report.. I'm wondering how can i return a new line like for example im a field which is bound to a a datatable where in if the number of text reach the maximum width of the field it would carry to the next line?.
Like if i had a text that is "Representation and other incidental allowances" since it exceeds the width of my field , i want to display like below:
"Representation and other
incidental allowances"
Hope someone could help me!.. Thank you!
Campagnolo_1 says you will need a formula, but I can assure you a formula is not necessary. All you need to do is place your column where you want it, give it the width you want, and right click on the field, select "Format Text", go to the tab labelled "Common" and check the box next to "Can Grow". To the right of this option, you will be able to select how many lines this field can 'grow', in other words, this is how many additional lines the field will use to display your text.
You will have to create a formula in the "Can Grow" option under "Format Field" (right-click on field). You will have to specify after how many characters you'll want the new line, so that could be tricky if your text changes.

Add date to to Crystal Report Text Object

I have a Text Object on my report which is contains some text. What I'd like to do is add a date to the text object that will alaways show the current date. I've tried using a date field, but it is near impossible to line it up correctly.
Any ideas on how to do this? I've been told that there is a way to do this using something like &[], but I can't figure out how.
Thanks!
You can edit the date inline, double click on the text field then select the date text, you can now click on the formatting button on the toolbar and setup the date format.
You can drag any field, including special ones (Print Date for example) into text object - it will line up without problems.

format number in ssrs report

argh!
Can't stand it that i can't figure it out myself....
i've used this in the formatting of a number in my report:
'€' #,0.00;('€' #,0.00)
and that formats to € 1,212.89
which is not exactly what i want, because i want € 1.212,89
regardless of the regional setting of the server.
So i tried this
'€' #.0,00;('€' #.0,00)
but that gives me this:
1.212.890
Typing this i realize that i don't know what the # and the . and the , mean in the format string.....
You can find the definition of the comma and period dynamic behavior here:
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
I think the best way to reliably get what you want is to hard code a locale into the expression for this field.
= (new Decimal(11123.55)).ToString("€#,0.00;(€#,0.00)",
new System.Globalization.CultureInfo("es-ES"))
This will always use the comma as decimal, and period as millions, thousands &c.
There are ways to be more dynamic and always return in the clients local set format, that would usually be preferable.
I know this is an old thread, but in case someone needs it, there is an easiest and most proper way to do it :
Right click on the Textbox of your expression
Select "Number" in the popup "Text Box Properties"
In the "Category", select "Number"
Tick the "Use 1000 separator
Click OK
To "customize" your '1000 separator':
Select the Textbox of your expression
In the Properties on the right, apply the right culture in the "Language" property.
E.g. Select "fr-CH" to have 123'456 otherwise the default is 123,456 as English separator.
Try this out. It will format your value to the correct number of decimal places.
=format(1212.89,"€#,#.00")
For indian currency, in the field value use like =Format(Fields!ServiceTaxAmt.Value,"##,##,##,###.00") and change the language value to hi-in for report property.
You can use the format € #,0.00 and set the language of your report to de-DE by clicking outside of the report area and in the right properties pane go to Localization -> Language.
This Works correctly with [set Language as hi-IN and Format as "##,##,##,###.00"]
Appreciate your Efforts
Also Same can be achieved by following Steps
Go to Text Box Properties
Select Number category in Number Tab
Check the check box beside [Use 1000 separator(,)]
Click Ok