Link to home
Start Free TrialLog in
Avatar of Raj G
Raj G

asked on

How to export multiple telerik grids to formatted single excel file in asp.net?

I am using Telerik radtabstrip to display multiple telerik grids.
I want to export all the grids into single excel file into multiple tabs on button click. The data should be exported to excel file using the excel template in the solution. This excel template is customized with colors and headers.
Avatar of Ess Kay
Ess Kay
Flag of United States of America image

The tabs on the bottom are called sheets or worksheets

You will need to loop through each GRID, and save them to an incrementing excel sheet



The Telerik documentation for these functions are here: http://www.telerik.com/help/aspnet-ajax/grid-excelbuilder.html


Exporting code is found here: http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/excel-export/defaultcs.aspx


IN the defaultCS.aspx you will need to add your loop






PROJECT DESCRIPTION
This project illustrates how to export multiple RadGrid controls into
single Excel/PDF file by using another RadGrid to wrap the contents.
Please notice the ExportOnlyData="false" property, intentionally set
on the wrapper to ensure that the nested controls will be exported.

You can download a competed project here:
http://www.telerik.com/support/code-library/export-multiple-radgrids-in-single-pdf-excel-file
Avatar of Raj G
Raj G

ASKER

Let me explain my question clearly. I have a excel template saved in a folder in my asp.net website. when i click the button I want to open that excel template in a new excel instance and write data to that new excel file.
i am aware of the 3 example you posted. I don't want to it in that way because my excel template have some conditional formatting which will trigger when data is being written to the excel template.
ASKER CERTIFIED SOLUTION
Avatar of Ess Kay
Ess Kay
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Alternitavely, you can export the data insto a dataset, and use the for exporting.
You will need a different excel library


There are some examples here using Microsoft.Office.Interop


http://social.msdn.microsoft.com/Forums/vstudio/en-US/454f7a31-11bf-4485-869d-94c263bb1f5a/export-dataset-to-existing-excel-spreadsheet
Avatar of Raj G

ASKER

if it doesn't work for Telerik grid, how can I export multiple datatable to multiple tabs in excel template