Error Saving Excel file - No open entry

Posted by: aspnetdev on 8 September 2017, 3:17 pm EST

  • Posted 8 September 2017, 3:17 pm EST

    We use Farpoint spread (version 7.35.20132.1) for our windows application. One of the feature we have uses fpSpread.SaveExcel function in following way.


    using (MemoryStream strm = new MemoryStream())
    {
    sheets.SaveExcel(strm, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
    }


    Few of our users started getting following error from SaveExcel method intermittently.

    Inner Exception
    ---------------
    Type : System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Message : No open entry
    Source : FarPoint.Excel
    Help link :
    Data : System.Collections.ListDictionaryInternal
    TargetSite : Void CloseEntry()
    Stack Trace : at ICSharpCode.SharpZipLib.Zip.ZipOutputStream.CloseEntry()
    at fg.a(IExcelWrite A_0, String A_1, Stream A_2, ExcelSaveFlags A_3)
    at FarPoint.Excel.ExcelFileHandler.b(Stream A_0, ExcelSaveFlags A_1)
    at FarPoint.Excel.ExcelFileHandler.Save(Stream stream, ExcelSaveFlags saveFlags, String password)
    at ci.a(Stream A_0, ExcelSaveFlags A_1, String A_2)
    at c9.a(String A_0, Stream A_1, ExcelSaveFlags A_2, ExcelWarningList A_3, String A_4)


    So far we have not been able to replicate this issue on any Developer machines.

    Can you please help us understand what could be the reasons of this failure ? Under what circumstances Farpoint code can fail with this exception ?

    Thank you.
  • Replied 8 September 2017, 3:17 pm EST

    Code lines went missing from my original post. Here is how we call SaveExcel method.

    using (MemoryStream strm = new MemoryStream())
    {
    sheets.SaveExcel(strm, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
    }
  • Replied 8 September 2017, 3:17 pm EST

    Hello,

    It could be dependent on size of SpreadSheet data. Hence, could you save your spreadsheet to XML (using the Save function)? Then zip and send that file for us to debug the issue at our end.

    However, in the meantime please go through this link which explains some information on inner exception:-
    https://msdn.microsoft.com/en-us/library/system.exception.innerexception(v=vs.110).aspx

    And also, I suggest trying different overloads which use Stream, and see whether you get an exception creating the FileStream to pass to OpenExcel.

    Please share your observations on the same. We will look into this issue further.

    Thanks,
    Reeva
  • Replied 8 September 2017, 3:17 pm EST

    Thanks for your response.

    The InnerException I pasted in my original post is associated with main exception. I did not include full exception message because it was not relevant for this topic.

    We just want to know under what situations FarPoint.Win.Spread.FpSpread.SaveExcel method can fail with "No open entry" exception. May be our Spread object does not have correct sheets or has bad values in it ?

    So far only a few users get this error intermittently and we cannot reproduce this error on developer machines at all even if we try the exact same case.

    So we were hoping that you could provide us more insights on SaveExcel method. We can then at least look into some specific direction and determine if our code has any issues in setting sheets value or any other issues of that nature.

    Thanks!
  • Replied 8 September 2017, 3:17 pm EST

    Hello,

    It could be a permission issue; do you have write access to the folder path where you save the file on the server?

    And as you said its an intermittent issue. Hence, we need sample application replicating the issue so that we can investigate this further and come to some conclusion.

    Thanks,
    Reeva


Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels