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

RadGrid : Export to Excel : ExcelML Not Working

3 Answers 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
px
Top achievements
Rank 1
px asked on 15 Jan 2009, 01:14 PM
Hi Guys,

I am trying to export RadGrid data into ExcelML format but the resulting spreadsheet is always empty. If I set the format to HTML the data is all there but the HTML content I have in one of the fields is broken over a number of rows. Is there any reason why ExcelML isn't working?

Cheers

Peter


View File:

 

<telerik:radgrid ID="gvHotels" runat="server" OnNeedDataSource="gvHotels_NeedDataSource" GridLines="None" Skin="WebBlue" autogeneratecolumns="true" visible="true">

 

 

<MasterTableView DataKeyNames="HotelCode" CommandItemDisplay="None" currentresetpageindexaction="SetPageIndexToFirst" dir="LTR" frame="Border" tablelayout="Auto" allowsorting="True" showfooter="false">

 

 

<RowIndicatorColumn Visible="False" currentfilterfunction="NoFilter" filterlistoptions="VaryByDataType">

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn Visible="False" Resizable="False" currentfilterfunction="NoFilter" filterlistoptions="VaryByDataType">

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

<editformsettings>

 

 

<editcolumn currentfilterfunction="NoFilter" filterlistoptions="VaryByDataType">

 

 

</editcolumn>

 

 

</editformsettings>

 

 

<columns>

 

 

</columns>

 

 

</MasterTableView>

 

 

<exportsettings>

 

 

<pdf fonttype="Subset" papersize="Letter" />

 

 

<excel format="ExcelML" />

 

 

<csv columndelimiter="Comma" rowdelimiter="NewLine" />

 

 

</exportsettings>

 

 

</telerik:radgrid>

 




Code-Behind File:

 

protected void gvHotels_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

 

{

gvHotels.DataSource =

TraxExporter.GetHotels();

 

}

 

 

protected void cmdExportHotels_Click(object sender, EventArgs e)

 

{

gvHotels.ExportSettings.ExportOnlyData =

true;

 

gvHotels.ExportSettings.IgnorePaging =

true;

 

gvHotels.ExportSettings.OpenInNewWindow =

true;

 

gvHotels.MasterTableView.ExportToExcel();

}

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 15 Jan 2009, 02:19 PM
Hello Peter,

I tried to reproduce the problem you described (using the provided code) but without avail. My test project is attached to the post. Please test it locally and let me know if you face an unexpected behavior.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
px
Top achievements
Rank 1
answered on 15 Jan 2009, 04:23 PM
Ok. I can get it to work by copy all the information from my List<ProductDetails> to a DataTable. This suggest there is a problem with the Grid component (or at least with my version of it). Anyway, this a good enough workaround for me right now.

Thanks for you help.

Cheers

Pete
0
Daniel
Telerik team
answered on 15 Jan 2009, 05:02 PM
Hello Peter,

Thank you for the clarification.

For such scenarios I recommend you set UseAllDataFields="true".

Try the suggested approach and let me know whether this helps.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
px
Top achievements
Rank 1
Answers by
Daniel
Telerik team
px
Top achievements
Rank 1
Share this question
or