This is a migrated thread and some comments may be shown as answers.

[Solved] Extra folder created on Export to Excel

1 Answer 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 16 Feb 2010, 06:54 PM
Hi,

I use the export to Excel function of radgrid, my users have been reporting that when they press "save" from the export dialog there is an extra folder created on their desktop with the same name as the XL file.  Opening the XL file everything looks normal but when they email the XL file to anyone else it seems that ll the data is actully in the extra folder and the emailed file will not open correctly.  Is this something that you are aware of?

We're using IE8 and Q3 2009.

Cheers
Jonathan

    protected void btnExport_Click(object sender, EventArgs e)  
    {  
        LoadResults();  
        radGridResults.ExportSettings.FileName = "FaCTS_" + Request.QueryString["ReportType"] + "_" + DateTime.Now.Day.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString();  
        radGridResults.ExportSettings.ExportOnlyData = true;  
        radGridResults.ExportSettings.IgnorePaging = true;  
        radGridResults.ExportSettings.OpenInNewWindow = true;  
        radGridResults.MasterTableView.ExportToExcel();  
    }  
 
    protected void LoadResults()  
    {  
        //Type reportType = Type.GetType("FaCTSServer." + Request.QueryString["ReportType"].ToString() + ", FaCTSServer, Version=1.0.0.0, Culture=neutralPublicKeyToken=null");  
        //IList _results  = (IList)Activator.CreateInstance((typeof(List<>).MakeGenericType(reportType )));  
 
        Type serviceType = Type.GetType("FaCTSServer." + Request.QueryString["ReportType"].ToString() + "Service" + ", FaCTSServer, Version=1.0.0.0, Culture=neutralPublicKeyToken=null");  
 
        object[] parameters = new object[] { txtSqlWhere.Text };  
 
        try  
        {  
            //Invoking a static method (How to invoke a static method??)     
            IList _results = (IList)serviceType.InvokeMember("GetSearchResults", BindingFlags.Default | BindingFlags.InvokeMethod, null, null, parameters);  
 
            //load the clients  
            //_results = PersonService.GetSearchResults(txtSqlWhere.Text);  
              
            ReportColumn _col;  
            GridBoundColumn boundColumn;  
            radGridResults.MasterTableView.Columns.Clear();  
            foreach (ListItem item in chkLstColumns.Items)  
            {  
                if (item.Selected == true)  
                {  
                    //add a column to the report grid  
                    _col = ReportColumnService.GetByID(Int32.Parse(item.Value));  
                    boundColumn = new GridBoundColumn();  
                    radGridResults.MasterTableView.Columns.Add(boundColumn);  
                    boundColumn.DataField = _col.DisplayName;  
                    boundColumn.HeaderText = _col.Heading;  
                    boundColumn.SortExpression = _col.SearchName;  
                }  
            }  
            radGridResults.DataSource = _results;  
        }  
        catch  
        {  
            throw new ArgumentException("The SQL Where clause was incorrect, please contact your sysadmin");  
        }  
      
    }  
 

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Feb 2010, 04:44 PM
Hello Jonathan,

Yes, we are aware of this behavior. Please try the following options:

1) Save the file in another file format. Press F12 or ALT+F2 (equivalent to File -> Save As...) and select Excel Workbook (*.xlsx) or Excel 97-2003 (*.xls)

or

2) Use ExcelML format.
ExcelML export help topic

<ExportSettings ExportOnlyData="true">
    <Excel Format="ExcelML" />
</ExportSettings>

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or