Hello,
we are using the "UltraGridExporter" to export datas from an ultraingrid to excel. After upgrading our solution from the very old version 2010/3 to 2018/2 we have two issues:
#1: Decimal-Columns are in the wrong format: The result ist by example "923.000", expected is "923.00"
We use this code, wich works perfect in the old version:
private static void grdExport_InitializeColumn(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.InitializeColumnEventArgs e) { if (e.Column.DataType == typeof(Decimal)) { e.ExcelFormatStr = "#,#0.00"; } }
#2: Columns with drop-down-combos shows this combo also in excel.
See this screenshot:
The whole excelfile contains only "5500" (Ultragrid was filtered before exported)
The combo shows every value from the grid
What can we do?
Greetings from germany, Karsten Heimer.
So I guess some properties take the Invariant culture and some need a culture-specific format string. And we must have changed that at some point. But I'm glad you got it resolved.
Hello Mike,
i have solved the problem, but the solution is very odd for me:
- While exporting to excel i have to use this string: "#.#,00"
- But, everywehere else, even in ultraWinGrid i have to use this string: "#,#.00"
Example:
- grdBuchungen.DisplayLayout.Bands[0].Summaries["Mengensumme"].DisplayFormat = "{0:#,#.00}";
Greetings from Germany, Karsten Heimer.
I dug up the version you are using (18.2.277) and I do not see a problem with that version on my machine.
So now I'm thinking this must be something specific to your machine. I see that you mention you are in Germany, so presumably the regional settings on your machine are using German. Doesn't German use a comma (instead of a decimal) as the decimal separator? So maybe the format needs to be: "#,#000" (with a comma between the two "3" signs?
Very strange. So I see the problem (three zeroes) in the Excel file you sent me. And I looked at the Format of the cell and it shows: "#.#000" So that's clearly wrong. And if I manually change the format on the cell to "#.#000", it works fine.
So the problem lies in the Excel file being generated by the application. Which seem to indicate a bug in the exporter. I don't remember any bugs like that. And it seems very strange that the exporter would just add an arbitrary 0 onto the format. But maybe there was such a bug in the version you have and it was fixed.
I'd be curious what happens on your machine if you change the code to have only ONE zero ("#.#000")? Does the output show two zeroes in that case?
About updating: We cannot update from version 2018.2 because our subscription is expired. The last version wich is listed in my account is 20191.112 but i cant download this version. I forgot to download this version during our active subscription period and now its impossible to upgrade...