SaveExcel too slow

Posted by: pierre-bavais on 8 September 2017, 2:39 pm EST

  • Posted 8 September 2017, 2:39 pm EST

    Hi,



    The SaveExcel method is particularly slow. Saving a file from a few hundred kb takes easily more than a minute.


    We use the flag "NoFormulas".



    SaveExcel(fileName, FarPoint.Excel.ExcelSaveFlags.NoFormulas);


    We are using the FpSpread for windows forms 5.0.2018. 


    We reproduce the case with a simple application that open an Excel file and save it with the SaveExcel function.


    Do you have any idea why this is so slow ?


    Thanks in advance


    Pierre


    PS: If necessary, you can download a zip file containing the solution of my test application and the Excel file imported before calling SaveExcel:


    ftp://ftp.bvdep.com/public/webaddin/TestSaveExcel.zip


     

  • Replied 8 September 2017, 2:39 pm EST

    A few hundred Kb doesn't sound that large, where are you saving it to? Is it a local drive or across a network? Can you attach the excel file you are using to produce this?
  • Replied 8 September 2017, 2:39 pm EST

    The file contains only data, no formula and it is on my local drive.


    I don't know how to attach a file with a reply but the excel file can be found in the folowing zip file:


    ftp://ftp.bvdep.com/public/webaddin/TestSaveExcel.zip

     
  • Replied 8 September 2017, 2:39 pm EST

    Hell0,

    Can you please send us the Excel file which you are importing in Spread and then Exporting it back to Excel because an Excel file of 328 Kb took somewere around 2 seconds o import and around 4 seconds to export here at my end.

    I would request you to please send us your Excel file in order to proceed further. Thanks.

  • Replied 8 September 2017, 2:39 pm EST

    Hi, the file is bigger than the maximum attachment size allowed.


    So, I've include it into a zip file that you can download from the 2 following links:


    ftp://ftp.bvdep.com/public/webaddin/TestSaveExcel.zip


    Http://client.bvdep.com/files/TestSaveExcel.zip


    Thanks


    Pierre

  • Replied 8 September 2017, 2:39 pm EST

    Hello,

    We are able to replicate the issue at my end and the bug number for the same is #99922035 wherein SaveExcel is taking a lot of time. This will be fixed in our next maintenance build of Spread 5.

    Thanks.

  • Replied 8 September 2017, 2:39 pm EST

    Great ! Thank you for your support.


     Pierre

  • Replied 8 September 2017, 2:39 pm EST

    When I put that address in my browser it can't open the page, you can attach a file here if you click the options tab above where you compose your replies and then Add/Update.

  • Replied 8 September 2017, 2:39 pm EST

    The maximum size allowed for an attachment is 256 Kb :-(


    I've put the file in another location : Http://client.bvdep.com/files/TestSaveExcel.zip


     

  • Replied 8 September 2017, 2:39 pm EST

    Hello,

    We have got the response from the development team regarding bug number #99922035, they need some more time to fix this bug. So, we can't fix it for this release but we will try to optimize this use case further in the next one. However, you can use the workaround suggested by the development team. They suggest that we can improve the performance by reducing the number of rows and columns in Spread at the time the Excel file is loaded into Spread, by simply removing the empty rows and columns. You can do the same using following two methods:






    1. Use TruncateEmptyRowsAndColumns when opening file(open time increase 9 time and save time decrease 3 time). This work around save ~10 of 70s (total for opening and saving is 60s).



    2. Truncate manually, for example using this code:


                      

                             fpSpread1.SuspendLayout();


                             foreach(SheetView sheet in fpSpread1.Sheets)


                              {


                                  sheet.RowCount = 70;


                                  sheet.ColumnCount = 100;


                              }


                            fpSpread1.ResumeLayout();



    The save time decrease 4 time. This work around save ~15 of 70s (total for opening and saving is 55s).

     

    Hope it will help you. Please let me know if you have any queries further.

     

    Thanks,

    Manpreet Kaur.

     

Need extra support?

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

Learn More

Forum Channels