EEPlus currency format with £? - epplus

I'm using "£#,##0.00" as a number format when creating spreadsheets using EEPlus.
When you look at the spreadsheet created the format has been modified to "\£#,##0.00". This still displays okay in Excel but doesn't if anyone previews the spreadsheet using the viewer on an iPhone. The £ symbol isn't shown and it doesn't limit to only showing two decimal places.
If I use the same format but with the Dollar or Euro symbols, it doesn't have the problem.

Related

SSRS export to Excel force number to be a text value

Using SSRS
All the other questions are how to force the number to show as a number instead of text when exporting to Excel
Meanwhile I want to force the number to show as a text so that Excel does not turn number 6158.30 to 6158.285 which is causing me round up issues.
My SQL uses cast to 2 decimal places CAST(ROUND(Net, 2) AS decimal(18,2)), in Excel it shows as 6158.30 but when you click on the cell its showing 6158.285.
I have tried concatenating ' + value but it exports the data as 'value and NOT force the cell to show as a text data.
I don't think it makes sense to try to turn the number into text, when all you are trying to do is to prevent the number displaying with more than 2 decimal places in Excel.
From the behavior you have described, it sounds like that for the textbox, you are currently using an SSRS expression like:
=Fields!Net.Value * 148.5
and using the Format property of the textbox to display to 2 decimal places.
Instead, for the SSRS expression, try:
=Round(Fields!Net.Value * 148.5, 2)
No need to set the textbox's Format property (unless you want commas etc).
Then that textbox column should stay as a number to 2 decimal places, when the report is generated to Excel, and the cell selected.

VBA erases local currency number format

I am trying to apply a number format from a named cell to another one, where the source cell format can be a percentage, a currency (€ in my case) or whatever. My code uses the .NumberFormat range property and looks like the one below:
For newCell in newCellsRange
Range("newCell").Value = some_calculation()
Range("newCell").NumberFormat = Range("sourceCell").NumberFormat
Next newCell
It works fine for what concerns the way the range is displayed on the sheet (be it a percentage, a currency or a date).
However, if this very same range is linked to a bar chart and its value used as a label (no fancy formatting, right click on the series > add data labels and that's all), the label format will change when I trigger the macro that updates the chart source range (newCellsRange in my example): the format will change from the Euro currency format to an improper American one: 1 523€ will become 1,523 $, 235 € will become ,235 $.
To give further details, I've found out that the .NumberFormat property of the range is "#,##0 $" (which displays €) while the chart label's one is "# ##0 $". I don't have a clue:
why the macro would make the comma disappear as I don't do anything for that
why "#,##0 $" would show up as € on the spreadsheet while "# ##0 $" would be $.
What can I do not to get this weird format switch?
In case this helps (which I doubt): Excel 2013 32 bits (English version) on W7 Enterprise (English version)
The number format depends on two things. At first on the locale settings of the Windows operating system and at second on the chosen format in Excel. So the "Currency" format can be different dependent on the locale settings. With comma or point as decimal point or with different currency symbols. But in English Excel versions its name will always be "Currency".
In VBA the default language is always US English. This is a dilemma with number formats because the default in US English is the decimal point and $ as currency symbol. So the "Currency" format, taken from the Range.NumberFormat property, will be "#,##0.00 $" also in my German Excel.
If I assign Range.NumberFormat = "#,##0.00 $" in my German Excel then the sheet will map this to the locale "Currency". Why the Chart then has problems with this? I don't know.
Microsoft tries to solve the dilemma in VBA by having ...Local properties. So
For newCell in newCellsRange
Range("newCell").Value = some_calculation()
Range("newCell").NumberFormatLocal = Range("sourceCell").NumberFormatLocal
Next newCell
may solve your problem.

Excel export from Pentaho Report Designer missing commas

Using Report Designer, when I preview the data in a PDF, the number formatting for PDF is correct in which there is a thousands separator--a comma after 3 digits--but the Excel output has it missing.
Excel - 857320
PDF - 857,320
What changes can be made to the attributes so that the comma is present for the Excel export as well?
Selecting #,##0 in format of the attributes of number-field gets the comma after 3 digits.
It seems in pdf it would work even without this format specification but for excel export it needs to be there.

How can I convert columns into a single, pipe-separated column without losing scientific notation?

I have used this VBA code to convert columns into pipe separated format. However, the data contains numbers in scientific notation (eg 2.000000e-01) which Excel automatically converts into 0.2 which I don't want.
I have tried changing this code:
var = Application.Transpose(Application.Transpose(rng.Value))
into
var = Application.Transpose(Application.Transpose(rng))
or even
var = Application.Transpose(Application.Transpose(rng.Text))
neither of which work. I've also tried formatting the cells all to Text (the macro then gives a Value error) or even switching off scientific notation.
How can I convert columns into a single, pipe-separated column without losing scientific notation?
Sample columns:
SAMPLE TEST 2.000000e-01 2.000000e-01
You want to concatenate text values using either the CONCATENATE function or the & operator. For the scientific notation, you want to use the TEXT function. Excel is actually storing the numbers as 0.2 but then displaying them in scientific notation.
The help for the TEXT function says:
Syntax: TEXT(value, format_text)
Display scientific notations:
To display numbers in scientific (exponential) format, use the following exponent codes in the format_text argument.E (E-, E+, e-, e+) Displays a number in scientific (exponential) format. Excel displays a number to the right of the "E" or "e" that corresponds to the number of places that the decimal point was moved. For example, if the format_text argument is "0.00E+00", Excel displays the number 12,200,000 as 1.22E+07. If you change the format_text argument to "#0.0E+0", Excel displays 12.2E+6.
So for your example, assuming the values are in cells A1:D1, use:
=A1&"|"&B1&"|"&TEXT(C1,"0.000000E+00")&"|"&TEXT(D1,"0.000000E+00")
Or in VBA, you can use the Text property of the Range object to get the contents of the cell as they are displayed. If the column width is too narrow for a date and the column shows "########" then that is what the Text property will return.
EDIT: I misread the post. This answer is for separating text from one column into many columns. OP is trying the reverse.
You use the Excel Text to Columns wizard (on the Data tab, select Text to Columns). Select your data, then run click the menu. When you get to step 3, tell Excel that you want to keep the column as Text.
If you need this done using VBA, then use the macro recorder to get the initial code which you can then tweak to fit your needs.

separate currency numbers by comma in exported pdfs of stimulsoft

I have a report containing a currency text filed. I want to separate it's number by coma, every 3 digits. so I changed it's Text Format from it's Properties.
It's OK in normal display, but when I export this report to a PDF file, then it's currency numbers doesn't display well.
Please help me about this problem.
You can use formats.
For example you can fill your text field with:
Price is: {Format("{0:C}", MyPrice)}