not able to open spread in excel file with custom headers

Posted by: banshpatel on 8 September 2017, 3:03 pm EST

  • Posted 8 September 2017, 3:03 pm EST

    Hi,

    I am not able to open spread in excel file with custom headers if I am using AddColumnHeaderSpanCell.

    this.fpSpread.ActiveSheet.AddColumnHeaderSpanCell(1, 0, 1, this.fpSpread.ActiveSheet.ColumnHeader.Columns.Count); 

    Cursor.Current = Cursors.WaitCursor;
                        // have all the windows info be saved with the file
                        string tempdir2 = "d:\\textFile.xls");
                        //turn off protect so excel can be edited
                        this.fpSpread.Sheets[0].Protect = false;
                        // save work book to excel, export headers
                        this.fpSpread.SaveExcel(tempdir2,FarPoint.Win.Spread.Model.IncludeHeaders.BothCustomOnly);
                        // shell out to DOS
                        System.Diagnostics.Process proc2 = new System.Diagnostics.Process();
                        proc2.EnableRaisingEvents = false;
                        proc2.StartInfo.FileName = (tempdir2);
                        proc2.Start();

    I am getting following error after executing the above code:
    ------------------------------------------------------
    SummaryToExcel - Specified cast is not valid.
    ---------------------------OK  ---------------------------

    I am using FarPointv4.0 with windows c#

  • Replied 8 September 2017, 3:03 pm EST

    Hello,

    I was not able to replicate the issue at my end with the latest version of Spread for Windows Formsv4, v4.0.xx26. Please have a look at the attached sample and the exported excel file. I would suggest you to test the issue with the latest version of Spread for Windows Formsv4, v4.0.xx26 to see if it resolves the issue that you are currently facing. You can download the same from the following link:

               ftp://ftp.fpoint.com/SpreadWinForms4/

    However, if you still face the same issue I would request you to modify the attached sample to depict your issue so that I can replicate the issue at my end and debug it further.

    Thanks,

    Manpreet Kaur


    2013/01/ExportExcel and file.zip
  • Replied 8 September 2017, 3:03 pm EST

    Hi,

    I am still getting same issue over the below line of code:

    this.fpSpread1.SaveExcel(tempdir2, FarPoint.Win.Spread.Model.IncludeHeaders.BothCustomOnly);

    I am getting exception: specified cast is not valid.

     The correct version of farpoint I am using is:v4.0.2003.

    Please help me to resolve the same.

  • Replied 8 September 2017, 3:03 pm EST

    One more point: I am getting the same exception in the code you have attached too.

    Please look into this as soon as possible.

     

    Thanks,

    Bansh

  • Replied 8 September 2017, 3:03 pm EST

    Hello,

    I was able to repliacte the issue with the older version i.e v4.0.xx03, however the issue is not reproduced with the latest
    version of Spread for Windows Formsv4, v4.0.xx26. The issue might have been a bug in the older version. So, I would suggest you to update to the latest version of Spread for Windows Formsv4,
    v4.0.xx26 to resolve the issue that you are currently facing.
    You can download the same from the following link:

               ftp://ftp.fpoint.com/SpreadWinForms4/

    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