format number in ssrs report - ssrs-2008

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

Related

Is There a Way to do a Spanish/English MailMerge?

I have an SSRS report that has Spanish and English text boxes. If the dataset row is a Spanish speaking person, an expression in each Spanish textbox shows that and hides the English textbox. These textboxes are exactly placed over each other.
My boss wants me to use SSRS to generate an Excel spreadsheet from the dataset(this is not hard) and use Word template for a mail merge. However, I am having trouble trying to figure out if I can hide all English when row is a Spanish row and vice versa. These are health clients of Spanish and English nationality.
I can do mail merges attached to a Recordset, I can do one in English, one in Spanish. I am trying to avoid this and have it all in one Mail Merge.
Areas marked in red will change to Spanish translation and/or date format. The dates are a no-brainer I can use a conditional IIF, however the formatted body I have no solution for, based on value in Field "CL_Language" which is either "Spanish" or "English".
====================================
The merge fields for dates and greeting are easy. There is no merge field for the text. And yes, only option might be for 2 separate reports with different Recordsets.
It's not clear what the actual issue is but...
Instead of hiding textboxes, which could cause problems when exporting etc., why not set a single textbox to the correct language text using an expression?
Something along the lines of
=IIF(Fields!Language.Value = "English", Fields!MyEnglishText.Value, FieldsMySpanishText.Value)
I found a solution. But it could be very difficult for the client to create. It involves hitting Ctrl + F9 which will create curly brackets {}.
Inside those curly brackets an IF statement is placed and I just pasted the whole Spanish formatted body in the true area, and the whole English body in the false area.
{IF "CL_Language" = "Spanish" "spanish body text here" "english body text here"}
Very strange syntax and you need to right click on the area to see choices like "Toggle Field Codes" (IF statement get's hidden), "Edit Field", and "Update Field". With Edit Field and Update Field you get a popup with the fields in your recordset.
If you saw the examples in my question, you can see that is some big clunky text AND . . .inside of it is a merge field that works! The Excel recordset comes already with the month name in correct language for each row.
Since it is not smart to include links that might expire, I am including the Google text I used to find this solution. Then I took a chance on a huge formatted chunk of text with a merge field inside of it.
Google this: "If Merge Field then"
Now is this a viable solution for the client versus just having a Word template for each language?
I think this is too difficult and I even duck when running it. Also, once it's working, if I look at the toggled code, the Conditional field no longer says the field name, but the value in the field, go figure.
{IF "Spanish" = "Spanish" or {IF "English" = "Spanish" instead of {IF "CL_Language" = "Spanish" or {IF "CL_Language" = "English"
Here is how to access the fields using right click. (remember, your curly brackets HAVE to be created with Control + F9).

Conditional use of $ on summary field

My summary field displays dollars. If the value is zero, I want to display a dash without the $ symbol. I currently have in the custom style settings to Show Zero Values as a "-", however, what I get in the report is "$-"
I see that there is a conditional formatting option, but I'm not sure how to refer to the summarized field in the code. How can I accomplish this?
Right click on the given field, go to Format Editor, and select Custom Style. Then click Customize... and Enable Currency Symbol. Click the X+2 button and enter the following formula:
If {yourFieldName} >= 0 Then
crFloatingCurrencySymbol
Else
crNoCurrencySymbol
If you prefer a fixed currency symbol, you can use crFixedCurrencySymbol instead of crFloatingCurrencySymbol.

Ignoring date column in beyond compare file comparison

I'm using BeyondCompare3 i've two files with lines containing with this kind of format.
abc,bbbb,cdef,test,14:45:23.123,info,comment
I want to omit the date from the comparison.
I've selected Session > Session Settings > Importance Tab > Edit Grammar button and created a new rule.
After entering an Element name, I've selected Category of Basic, checked Regular Expression and searching for Text.
[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,3}. I've also tried /[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,3}/.
I then click 'ignore unimportant differences' on the tool bar.
I was hoping this would ignore the date column in the comparison. But it doesn't.
Any pointers on this or other tools/scripts would be very much appreciated.
John.
In Beyond Compare 4.1.9, you can ignore Modified Date by unchecking "Compare timestamps" in tab "Comparison" of the "Rules" window.
You can also add a regular expression to define text to be ignored (Unimportant text) in the Rules section like so:
https://www.scootersoftware.com/vbulletin/forum/beyond-compare-2-discussion/beyond-help/2292-set-to-ignore-date-and-timestamp-difference
In a 'Table Compare' session, comparing both files do the following:
Select rules, tab columns;
Edit the date column;
Check the unimportant checkbox;
Enable minor (to ignore minor and unimportant differences);
A date tolerance is also an option, but that is not your question.

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.

Currency Symbol problem in Crystal Reports XI

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.