We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Out of memory exception while trying to read

Thread ID:

Created:

Updated:

Platform:

Replies:

106643 Jan 20,2013 06:52 AM Jan 22,2013 05:33 AM Windows Forms 6
loading
Tags: XlsIO
Christos Tatitzikidis
Asked On January 20, 2013 06:52 AM

Hi there,
I am getting an out of memory exception while trying to open an xlsx file of about 30 worksheets.

The same algorithm works fine with one or two sheets, even if the file size of the latter is larger - so i guess it's got to do with the number of sheets.

I am the latest ver (4.xx) of xlsIO

Here's the code:
excelEngine = new ExcelEngine();
excelEngine.Excel.Workbooks.Open(filePath, ExcelOpenType.Automatic);

the 2nd line throws an out of memory exception

Same code works fine for sheets with less worksheets, even if those worksheets contain a large number of rows (20000+).

Is there an alternative way of doing this?                    

Thanks,
Chris                   

Christos Tatitzikidis
Replied On January 20, 2013 06:54 AM

Sorry i am actually using XLSIO.Base v10.404.0.53

Christos Tatitzikidis
Replied On January 20, 2013 07:02 AM

This is the stack trace. It's funny because the xlsx file does not contain any images/charts etc.
I have tried all the ExcelParseOptions with no luck!

   at System.Drawing.Graphics.FromImage(Image image)
   at Syncfusion.XlsIO.Implementation.WorkbookShapeDataImpl.AddPicture(Image image, ExcelImageFormat imageFormat, String strPictureName)
   at Syncfusion.XlsIO.Implementation.Collections.HeaderFooterShapeCollection.SetPicture(String strShapeName, Image image, Int32 iIndex, Boolean bIncludeOptions, String preservedStyles)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Shapes.HFImageParser.ParseImageData(XmlReader reader, String shapeName, BitmapShapeImpl shape, RelationCollection relations, String parentItemPath)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Shapes.HFImageParser.ParseShape(XmlReader reader, ShapeImpl defaultShape, RelationCollection relations, String parentItemPath)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseShape(XmlReader reader, Dictionary`2 dictShapeIdToShape, RelationCollection relations, String parentItemPath)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseVmlShapes(XmlReader reader, ShapeCollectionBase shapes, RelationCollection relations, String parentItemPath)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.ParseVmlShapes(ShapeCollectionBase shapes, String relationId, RelationCollection relations)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseLegacyDrawingHF(XmlReader reader, WorksheetBaseImpl sheet, RelationCollection relations)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseAfterSheetData(XmlReader reader, WorksheetImpl sheet, MemoryStream& streamCF, String strParentPath, Dictionary`2 dictItemsToRemove)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseSheet(XmlReader reader, WorksheetImpl sheet, String strParentPath, MemoryStream& streamStart, MemoryStream& streamCF, List`1 arrStyles, Dictionary`2 dictItemsToRemove, Dictionary`2 dictUpdatedSSTIndexes)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.ParseWorksheetData(WorksheetImpl sheet, Dictionary`2 dictUpdateSSTIndexes)
   at Syncfusion.XlsIO.Implementation.WorksheetImpl.ParseData(Dictionary`2 dictUpdatedSSTIndexes)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseWorksheets(Dictionary`2 dictUpdatedSSTIndexes)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseWorkbook(List`1& themeColors)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseDocument(List`1& themeColors)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseExcel2007Stream(Stream stream, String password)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseStream(Stream stream, String password, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, Stream stream, ExcelParseOptions options, ExcelVersion version)
   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(Stream stream, ExcelOpenType openType, String fileName, 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, ExcelOpenType openType)



Christos Tatitzikidis
Replied On January 20, 2013 07:08 AM

Also if I convert the xlsx file to xls it works fine!

thanks,
Chris

Sridhar [Syncfusion]
Replied On January 21, 2013 01:43 AM

Hi Christos,
 
Thank you for using Syncfusion products.
 
We suspect the above reported exception occurs while parsing the header and footer images in XlsIO.However, inorder to reproduce the exception at our side we require the excel file which causes the above exception.
Could you please share us with the excel file which reproduces the out of memory exception so that we are able to proceed further on this.
 
Please let me know if you require any further clarifications.
 
Thanks,
Sridhar.S

Christos Tatitzikidis
Replied On January 21, 2013 08:21 AM

Hi Sridhar, and thanks for your prompt reply.

Could you send me an email I could send the file. It's confidential info, so I wouldn't like to share it with the rest of the forum.

Thanks,
Chris

Sridhar [Syncfusion]
Replied On January 22, 2013 05:33 AM

Hi Chris,


 Thank you so much  for the update.


Please open a new direct-trac incident with a simple issue reproducing sample and stack trace of the exception for further follow up on this issue.

 

The Direct – Trac supporting system is an confidential and we are not sharing the files with any of the customers. If you feel the Direct-Trac is not an confidential you can share the files in the secure net transmission by uploading the files on the net with password protection.


Direct-Trac Link:
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents


Please let me know if you require any further clarifications.

 

Thanks,

Sridhar.S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;