open xml file still slow

Posted by: edinsf on 8 September 2017, 2:09 pm EST

  • Posted 8 September 2017, 2:09 pm EST

    Hi Farpoint - Back in the Com days, we saved our spreadsheet files as .ss? files. It appears that in .net, xml is the format of choice. We use a model file to populate the Spread control. When I open it from the Designer, it takes 5 seconds. From vb.net it takes 35 seconds. I looked around and implemented what I could find in the way of suggestions (see sample code below), but it doesn't make much difference. How can I bring my code up to the speed of the designer open? Thanks!

    <FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT size=2> Button1_Click(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> sender </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Object</FONT></FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> e </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> System.EventArgs) </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Handles</FONT></FONT><FONT size=2> Button1.Click


    FpSpread1.SuspendLayout()


    FpSpread1.ActiveSheet.AutoCalculation = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    FpSpread1.ActiveSheet.AllowNoteEdit = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    FpSpread1.ActiveSheet.AutoUpdateNotes = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    FpSpread1.AllowCellOverflow = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    FpSpread1.Open(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"PGModel.xml"</FONT></FONT><FONT size=2>)


    FpSpread1.ResumeLayout()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub

    </FONT></FONT>
  • Replied 8 September 2017, 2:09 pm EST

    Hello,

    You are already using the methods and properties to enhance the performance.It some times depends on the file format , Is it possible for you to share that XML file?

    You should also be able to open and save Spread files e.g.

     FpSpread1.Save("D:\Spreadfile.ss7", True)     ' to save a file as Spread File

     FpSpread1.Open("D:\Spreadfile.ss7")            ' to open a Spread File

     

    Thanks,

  • Replied 8 September 2017, 2:09 pm EST

    Hi - I'm happy to share the file; however, if ss7 is an acceptable format for the .net product, I'd prefer to go that route. We don't have a good reason for using an XML format. I guess I was a little confused as to whether ss7 was OK for .net. Thanks for your help.


    Hi Again - I guess I spoke too soon - the ss7 format is just as slow. There must be something about our template file that's slowing the process, although as I mentioned, it opens very quickly in the designer.  Let us work with it here for a bit (maybe we can re-create the template file) and if I still need help, I'll attach a copy of the template file. Thanks


     

  • Replied 8 September 2017, 2:09 pm EST

    Hello,

    You can use the OpenSpreadFile method of Spread(.net) to open an existing file from the COM version of FarPoint Spread, such as FarPoint Spread 7.0. 

    <blockquote>

    FpSpread1.ActiveSheet.OpenSpreadFile("C:\oldfile.ss7")

    </blockquote>

    Thanks

Need extra support?

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

Learn More

Forum Channels