Hello,
we always set the cell FormatString for numbers in international localization "#,##0.00" even if the local/excel localization is different (german in this case). (https://msdn.microsoft.com/en-us/library/bb157877.aspx : the Excel Object Model Always Expects Locale ID 1033)
In Infragistics v10.3 this works fine, with v14.1 its not. it looks like it expects a localized FormatString.
GreetingsKiTs
Hello Martin,
Thank you for your feedback.
In Infragistics Components 12.1 and 13.2 we have cleared several issues related to numbers exporting. With this changes, the format strings were made culture-aware to be more in line with the behavior of MS Excel. In order to export numbers from UltraGrid to Excel as numbers you need to:
1. Set the Workbook culture to InvariantCulture. You can do this in ExportStarted event of UltraGridExcelExporter.
2. Set the EcxelFormatStr property of your numeric column to the same format as the UltraGrid numeric column is set.
Please note you need to use the same approach if you use XamNumericEditor. Attached I am sending you revised version of my sample solution where I have implement above mentioned steps.
Please let me know if you need any further assistance.
Hello Milko,
thanks for your answer. I cant download your sample right now, because your server seems to be under maintance; i will try tomorrow.
So that means all our FormatString's wont work anymore; is this change listed as Breaking Change anywhere we didnt saw?
edit: i was able to download it now. ok sure i could do it like that. but we are interested in your philosophy behind it. every control of yours takes international FormatString, like XamNumericEditor, right? MSDN says Excel expects international culture too. How it comes u changed this behaviour, of your previous version, here?
MSDN says:The common language runtime (CLR) automatically passes locale ID 1033 to all methods and properties in the Excel object model that accept locale-sensitive data. There is no way to change this behavior automatically for all calls into the object model. However, you can pass a different locale ID to a specific method by using InvokeMember to call the method and by passing the locale ID to the culture parameter of the method.
So r u explicit doing that, and for what purpose? (In which situation could u probably want/expect localized FormatString's? Managed by User?..)
greetz
Thank you for posting in our forum.
Yes you are correct. In Infragistics 14.1 you need to specify localized format string to UltraExcelExporter. In 14.1 the format string is exactly taken over to Excel. Please find attached a small sample solution showing how to set the Excel format string during export.
Please let me know if this is what you are looking for or if I am missing something.
Sincerely,
Milko
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support