My query returns a field like "In my honest opinion \r\n you guys can help me!". When I display this field on my report, the lines don't "break" as expected... what should I do?
You can use this Expression:
=Replace(Fields!YourField.Value, "\r\n", System.Environment.NewLine)
Found and answer:
Right Click textbox -> Expression and then:
=Fields!YourColumn.Value.ToString().Replace(",",vbCrLf)
Related
This is probably a very simple question, but i'm trying to write a formula which will display text depending on the value that is being run.
However, the text i require has the word "Floor" in it which is a function, therefore when i save the formula it warns me saying There is an error in this formula. Do you want to save it anyway?
Is there a way i can include the word Floor in the text, such as putting '' around the word?
For example
IF {database.column} = 3 THEN "3rd Floor"
try this, i think CR is expecting an Else statement
IF {database.column} = 3 THEN
"3rd Floor"
else ""
I found the issue, it was the fact that i had a line break in it without specifying it with Chrw().
Right-Click on feild then Formate Object & insert formula in Display string
IF {database.column} = 3 THEN '3rd Floor'
I am having a word document which is containing many words like this. I have shown below.
(00:05), (01:18), (09:45), (21:42)
How do I remove these words with single expression using wildcards?
Any help would be greatly appreciated!! Thanks!!
In Search and Replace dialog, you have "More >>" and you will be able to see the "Use wildcards" option. After tick, you can search \(*:*\).
Before :
(00:05), (01:18), (09:45), (21:42)
After :
, , ,
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
I am trying to customize a money field.
My goal is to achieve this format: -55,555 LEKE
But when I try to customize the currency symbol CR automatically removes the space between my price and the currency symbol (-55,555LEKE). I don't like this format. I tried everything.
Any ideas?
(Sorry for the delay, but your "crystal-reports-xi" tag isn't often used. Otherwise, someone might have answered this sooner).
Go into the Custom Style menu of your field.
Under Currency Symbol, choose Enable Currency Symbol and Fixed.
Change the position to -123$
Close the menu and left-align the field.
Now, all your currency symbols will be on the far right side of your field and the currency will be on the left. This isn't exactly what you're asking for, I know, but it's pretty close.
Alternatively,
Remove the currency symbol from your field entirely.
Make a text object with the currency symbol inside it.
Put the text object to the right of your currency field.
If you want to right-align your field and have that space between the symbol and the currency, this is the way to go.
I'm not sure what you're using to design the report, but in Visual Studio, it's possible to achieve this by modifying the CurrencySymbol property in the property list or setting it programmatically.
Format Field > Number > Customize >Currency symbol -> click on the 'x+2'
and type the following:
totext (' '&'LEKE').
in the field between the apostrophes-- ' '& type as many spaces as you require.
Then save.
Thanks for the answer.
I'd tried the first method you suggested, but it hadn't looked so pretty.
-123 LEKE
But I realized that this problem does not exist in older versions. So I put the currency symbol with Crystal Reports 7, and opened the document with Crystal Reports 11 and completed my design ;) But you should not enter the currency settings after opening with 11 or it swallows the space immediately.
I've got a crystal reports formula that displays a string based on an input
Simplified:
if (a=1) then
"Abc"
else
"Abcdefghijkl"
The problem is that I want this field right aligned. In the "Format Editor" I have set the "Horizontal Alignment" to be "Right", but it hasn't changed the formatting when I run the report.
Any idea's on to solve this?
I pulled up a .rpt of my own and mucked around with it. Does the output have alot of trailing whitespace, i.e. Abc________? If so, a simple trim() could fix it.
where _ is a whitespace. StackOverflow won't let me display whitespaces as white spaces