Hi
I have a problem with the following code in 13.2.2010 excel ( VS 2010 , .NET 4):
import of xlsx file ( no change in xlsx/C# file before the update)
------------------------------------------------------------------------------------
Workbook workBookImport = Workbook.Load(AppDomain.CurrentDomain.BaseDirectory + "Fiche_Technique_Client_template.xlsx", false);
var ms = new MemoryStream(); workBookImport.Save(ms);
MemoryStream msClone = DeepClone(ms);_wbk = Workbook.Load(msClone); // Exception here *1
public T DeepClone(T obj)
{ using (var ms = new MemoryStream()) { var formatter = new BinaryFormatter(); formatter.Serialize(ms, obj); ms.Position = 0;
return (T)formatter.Deserialize(ms); } }
I have and exception :
08:27 : qua.a : Export Excel The margins must be between 0 and 100.Parameter name : valueLa valeur réelle était 1,96850393700787E+16.
Infragistics4.Documents.Excel.v13.2
Void set_LeftMargin(Double) à Infragistics.Documents.Excel.PrintOptions.set_LeftMargin(Double value) à Infragistics.Documents.Excel.Serialization.Excel2007.XLSX.PartManagers.ObjectModelWorksheetPartManager.LoadPageMarginsElement(XmlPartManagerBase partManager) à Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.TryLoadNormalElement(QualifiedNameInfo elementName, String strictQualifiedName, Int32 currentChildIndex) à Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.LoadChildElementsHelper(Int32 currentChildIndex, AlternateContentStatus alternateContentStatus) à Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.TryLoadNormalElement(QualifiedNameInfo elementName, String strictQualifiedName, Int32 currentChildIndex) à Infragistics.Documents.OfficeOpenXml.Core.XmlReadManager.LoadChildElementsHelper(Int32 currentChildIndex, AlternateContentStatus alternateContentStatus) à Infragistics.Documents.OfficeOpenXml.Core.PartManagers.XmlPartManagerBase.LoadCore() à Infragistics.Documents.Excel.Serialization.Excel2007.XLSX.PartManagers.ObjectModelWorksheetPartManager.LoadCore() à Infragistics.Documents.OfficeOpenXml.Core.PartManagers.XmlPartManagerBase.Load() à Infragistics.Documents.OfficeOpenXml.Core.OfficeDocumentManager.LoadPart(IPackagePart part) à Infragistics.Documents.OfficeOpenXml.Core.OfficeDocumentManager.LoadPartRelationships(IPackagePart sourcePart, PartManagerBase sourcePartManagerPrototype, IEnumerable`1 relationships, Boolean hasSourcePartBeenLoaded, Boolean& wereRelationshipsSkipped) à Infragistics.Documents.OfficeOpenXml.Core.OfficeDocumentManager.LoadPart(IPackagePart part) à Infragistics.Documents.OfficeOpenXml.Core.OfficeDocumentManager.LoadPartRelationships(IPackagePart sourcePart, PartManagerBase sourcePartManagerPrototype, IEnumerable`1 relationships, Boolean hasSourcePartBeenLoaded, Boolean& wereRelationshipsSkipped) à Infragistics.Documents.Excel.Serialization.Excel2007.XLSX.ObjectModelExcelDocumentManager.LoadCore() à Infragistics.Documents.Excel.Serialization.WorkbookLoadManagerExcel2007.LoadCore() à Infragistics.Documents.Excel.Serialization.WorkbookLoadManager.Load() à Infragistics.Documents.Excel.Workbook.LoadXLSXFile(Workbook workbook, Stream stream, IPackageFactory packageFactory, Boolean verifyExcel2007Xml) à Infragistics.Documents.Excel.Workbook.LoadHelper(Stream stream, WorkbookFormat format, String parameterName, IPackageFactory packageFactory, Boolean verifyExcel2007Xml) à Infragistics.Documents.Excel.Workbook.Load(Stream stream, IPackageFactory packageFactory, Boolean verifyExcel2007Xml) à DecisioModules.Modules.Export.ExportDossierExcel..ctor(DecisioEntities db, Boolean export, MainForm mainFrm) dans C:\DECISIO\V3.1\DecisioModules\Modules\Export\ExportDossierExcel.cs:ligne 76 à DecisioModules.MainForm.GrilleAction(String s) dans C:\DECISIO\V3.1\DecisioModules\RibbonCommand.cs:ligne 618 à DecisioModules.MainForm.ruban_ToolClickExtern(Object sender, ToolClickEventArgs e) dans C:\DECISIO\V3.1\DecisioModules\RibbonCommand.cs:ligne 266 à DecisioModules.MainForm.ruban_ToolClick(Object sender, ToolClickEventArgs e) dans C:\DECISIO\V3.1\DecisioModules\MainForm.cs:ligne 453
I added Xlsx file if you could try it
ps : I try to go back to 13.2.1011 and it's work.
This is an important problem !!
Update : Workarround : switch to 2003 xls
Hello,
Thank you for the provided information.
The issue seems to be caused by the CurrentCulture set for the thread. It appears to happen only if the culture uses comma to indicate the decimal place. I have logged the issue in our internal tracking system and I have created a support ticket through which I will provide you with updates - CAS-129397-F2W6G4.
Meanwhile as a workaround I can suggest that you add the following line of code, for example in the constructor of your form:
Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
Thank you for using Infragistics components.
I try this but Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator
but i have an exception (readOnly) on globalisation*
mscorlibVoid VerifyWritable()
à System.Globalization.NumberFormatInfo.VerifyWritable() à System.Globalization.NumberFormatInfo.set_NumberDecimalSeparator(String value) à DecisioModules.Modules.Export.ExportDossierExcel..ctor(DecisioEntities db, Boolean export, MainForm mainFrm) dans C:\DECISIO\V3.1\DecisioModules\Modules\Export\ExportDossierExcel.cs:ligne 63
As I have updated you through the private case, I have logged the issue into our internal tracking system with ID of 160586. If the workaround I offered you is not applicable to your custom scenario, you should wait for our developers to review my investigation and to offer a fix, or other resolution.
Thank you for your patience and understanding.
Too much side effects for my application ...
It seems that you first need to assign a new CurrentInfo object to the CurrentCulture property of the current thread. The following lines should produce the desired result:
//I assume that French is the desired culture Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR"); Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
//I assume that French is the desired culture
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
Please let me know if you have any additional questions.