Exporting data from Petrel (Workflows) to Excel error - offset and length were out of bounds

882 Views Asked by At

I'm working with the Workflows module of Petrel (Schlumberger) Software. At one point I want to export the result into a xlsx type file. But this action produce an error which is "offset and length were out of bounds for the array or count is greater than the number of elements" and stop the workflows, also the excel file is not modified at all. I don't have a lot of freedom to access the lower level coding in this module. any suggestion regarding how to deal with this problem is appreciated.

This is the section of workflow and the problematic line is shown with the red rectangular :

It's the typical chart that is being copied

the function copies two set of data (x and y) and into a sheet of excel and draw the chart using the data in that sheet to draw the chart. It's about 100 set points of (x,y)

This is the Petrel Log:

Type : System.ArgumentException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection. Source : mscorlib Help link : ParamName : Data : System.Collections.ListDictionaryInternal TargetSite : Void ThrowArgumentException(System.ExceptionResource) HResult : -2147024809 Stack Trace : at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.List1.Reverse(Int32 index, Int32 count) at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseThemeColors(XmlReader reader, Dictionary2& dicThemeColors) at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseThemeElements(XmlReader reader) at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseThemes(XmlReader reader) at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseWorkbook(List1& themeColors, Boolean parseOnDemand) at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseDocument(List1& themeColors, Boolean parseOnDemand) at Syncfusion.XlsIO.Implementation.ApplicationImpl.CreateWorkbook(Object parent, Stream stream, ExcelVersion version, ExcelParseOptions options) at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelVersion version, ExcelParseOptions options) at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(String fileName, ExcelOpenType openType, ExcelVersion version, ExcelParseOptions options) at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(String filename) at Slb.Petrel.ExcelExporter.WorkstepExporterToExistingFile.PerformExport(String filepath) at Slb.Petrel.ExcelExporter.XlExportWorkstep.InvokeSimpleCore(Args argpack) at WorkstepCmd.run(WorkstepCmd* )

0

There are 0 best solutions below