ExportToExcelML Creating bad files?

5 posts, 0 answers
  1. Hannah
    Hannah avatar
    37 posts
    Member since:
    May 2013

    Posted 21 Jun 2013 Link to this post

    Seems that since I've upgraded the ExportToExcelML command has been failing on me.  It creates a file no problem, but I'm getting an "Excel cannot open the file 'blah.xlsx' because the file format or file extension is not valid." error.

    Here is what I'm doing (and this worked prior to the recent upgrade)


    void btnExportExcel_Click(object sender, EventArgs e)
    {
        this.SaveFileDialog.Filter = "Excel Workbook (*.xlsx) |*.xlsx|Excel 97-2003 Workbook (*.xls)|*.xls";
     
        if (this.SaveFileDialog.ShowDialog() == DialogResult.OK)
        {
            ExportToExcelML exporter = new ExportToExcelML(this.dgResults);
            exporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
            exporter.ExportVisualSettings = true;
            exporter.SheetName = this.GridTitle;
             
            if (Path.GetExtension(this.SaveFileDialog.FileName) == ".xls")
            {
                exporter.FileExtension = "xls";
                exporter.SheetMaxRows = ExcelMaxRows._65536;
            }
            else
            {
                exporter.FileExtension = "xlsx";
                exporter.SheetMaxRows = ExcelMaxRows._1048576;
            }
     
            try
            {
                this.lblReady.Text = "Exporting to Excel...";
                this.StatusStrip.Refresh();
                using (new UtilLib.Winforms.WaitCursor())
                {
                    exporter.RunExport(this.SaveFileDialog.FileName);
                }
            }
            catch (Exception ex) { UtilLib.Winforms.Feedback.DisplayError(ex); }
            finally
            {
                this.lblReady.Text = "Ready";
            }
        }
    }

    Anyone else experiencing the same issue?  

  2. Hannah
    Hannah avatar
    37 posts
    Member since:
    May 2013

    Posted 26 Jun 2013 Link to this post

    At this point I'll add, I'd be happy with a simply confirmation that this does or does not happen to anyone else.  lol  There has to be someone that could add to this, no?

    Thanks all!
  3. Ivan Petrov
    Admin
    Ivan Petrov avatar
    717 posts

    Posted 26 Jun 2013 Link to this post

    Hi Wayne,

    Thank you for writing.

    You are the first to report such an issue. I tried to reproduce it but I was not able to. I would kindly ask you to send some more information on your case. Which version did you upgrade from and to, what data do you export, a sample exported file might help as well. If you are able to reproduce the issue in a sample project and send it to me I will be able to investigate the issue further.

    Looking forward to your reply.

    Regards,
    Ivan Petrov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  4. Anwar
    Anwar avatar
    4 posts
    Member since:
    Oct 2012

    Posted 02 Jul 2013 Link to this post

    Hi,

    I'm having the same problem. The exported file is not saved as .xls and keep on saved as an xml
  5. Ivan Petrov
    Admin
    Ivan Petrov avatar
    717 posts

    Posted 05 Jul 2013 Link to this post

    Hello Anwar,

    Thank you for writing.

    We have accumulated all the information regarding exporting RadGridView to xls/xlsx and ways to avoid the message that appears when an exported file is opened into a Knowledge Base article which you can find by following this link.

    I hope this will be useful. Should you have further questions, I would be glad to help.

    Regards,
    Ivan Petrov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top