FarPoint Openexcel gets stuck when we call it fourth or fifth time in a row

Posted by: pooja.bansal on 26 March 2020, 9:26 pm EST

  • Posted 26 March 2020, 9:26 pm EST

    We are calling this method in backend through web api from frontend which is in Angular 7.
    In web application -
    When we call this method continuously several times(4-5), it gets stuck in this method and take around 7-8 minutes to get executed.

    In desktop application
    When we call this same method continuously several times, it works fine.

    Code -
    FarPoint.Win.Spread.FpSpread.OpenExcel(stream, ExcelOpenFlags.DoNotRecalculateAfterLoad);

    Kindly let us know the root cause and the solution to this problem asap.
  • Replied 29 March 2020, 7:00 pm EST

    Hello Pooja,
    There does not seem an issue in calling the code from API. It would be great if you may share the API method code snippet which is getting executed and return the response to API so that we may investigate at our end.

    Manish Gupta
  • Replied 1 April 2020, 12:31 am EST

    When we call API for fifth or sixth in a row

    >> We are calling SaveExcelSheet API

    >> In this we call preparesheet() method

    >> In prepare sheet We are using below both the methods in different conditions

    and both methods get stuck at form.InpRptSpread.OpenExcel(stream, ExcelOpenFlags.DoNotRecalculateAfterLoad); method for 6 to 8 min

    1. OpenExcel With Stream

    public override void InitializeSheetWithStream(MemoryStream stream)




    form.InpRptSpread.OpenExcel(stream, ExcelOpenFlags.DoNotRecalculateAfterLoad);



    2. OpenExcel With FileName

    public override void InitializeSheet(string fileName)




    form.InpRptSpread.OpenExcel(fileName, ExcelOpenFlags.DoNotRecalculateAfterLoad);



    >> Every time we get true from OpenExcel Method.

    >> After this we call our save method to save data in db.

    >> Below is our response from API

    HTTP/1.1 200 OK

    Cache-Control: no-store, no-cache, max-age=0

    Transfer-Encoding: chunked

    Content-Type: application/json; charset=utf-8

    Set-Cookie: fpmsessionid=6610d387-31fb-41b1-a30d-417c56d554af; expires=Thu, 02 Apr 2020 08:45:12 GMT; path=/;SameSite=Strict; secure; httponly

    Set-Cookie: FPM-XSRF-TOKEN=mAtN0jx039hDqenqmEsS2Sd6HW5XKb_TgLvMVLKYdiCd5Q1fYELK8gxeY0feWVMRZHV9pFW7QnOtrl_o69tQqUAdwyZCW8MtPXszf6LxLHc1%3asbKYUG_SohNnobANfkEq1K3nEMHb8O-qjoDTTGxlhxyrQJd2-PMVxv7nPWSKzLsg_3FwSQS3y7YmL5OebsFgiQCo179FY5ma9_ndQTIncO3_WKi9QVvqYHvcNuCV-f390; expires=Thu, 02 Apr 2020 08:45:12 GMT; path=/;SameSite=Strict; secure

    Access-Control-Allow-Origin: *

    Persistent-Auth: true

    X-XSS-Protection: 1; mode=block

    X-Frame-Options: DENY

    X-Content-Type-Options: nosniff

    Date: Wed, 01 Apr 2020 08:54:24 GMT



  • Replied 2 April 2020, 12:12 am EST

    Hi Pooja,
    We are working on this issue. We will let you know as we have an update on this.

    Manish Gupta
  • Replied 2 April 2020, 6:15 pm EST

    Hi Pooja,
    We tried to incorporate the FpSpread in the existing WebAPI project with the following code and it works fine with number of calls.
    private FpSpread spread = new FpSpread();
    public string SaveSheet(string fileName)
    this.spread.OpenExcel(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Files", fileName),FarPoint.Excel.ExcelOpenFlags.DoNotRecalculateAfterLoad);
    return "Spread Saved";

    Hence it seems that the issue is with SetDefaultValuesForSpread() method. Or probably you are using the WinForm app to call using API.
    Also, please share how you are passing the stream to the API. Also, share your use case with us so that we may suggest you accordingly.

    Manish Gupta
  • Replied 7 April 2020, 8:20 pm EST

    Hi Manish,

    In our case we are calling openExcel with two ways-
    1) By Stream - form.InpRptSpread.OpenExcel(fileName, ExcelOpenFlags.DoNotRecalculateAfterLoad);
    2) By File Name - form.InpRptSpread.OpenExcel(stream, ExcelOpenFlags.DoNotRecalculateAfterLoad);

    In both the cases it gets stucks for 5th or 6th time execution. So, it is not stream specific issue.
    Moreover, the issue is not with the SetDefaultValuesForSpread() method as, it gets stucks before that in openExcel method.

    Kindly provide the solution.

    Pooja Bansal
  • Replied 8 April 2020, 10:08 pm EST

    Hi Pooja,
    We are sorry for the inconvenience, we are able to understand your inconvenience but unfortunately, we were unable to replicate the issue at our end with the above code shared.
    Could you please share the excel file you are trying to load and causing performance issue after 5-6 load.

    If you are not comfortable in sharing the file on public forum, please create the private ticket on our SupportOne portal:

    Manish Gupa
  • Replied 13 April 2020, 11:14 pm EST

    Hi Manish,

    We have posted the Excel template in SupportOne portal: http://supportone.componentone.com/home/casedetail/431097

    Kindly look into the same.

    Pooja Bansal
  • Marked as Answer

    Replied 14 April 2020, 5:02 pm EST

    Hi Pooja,
    We have replied to the SupportOne portal.

    Manish Gupta
Need extra support?

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

Learn More

Forum Channels