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.
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.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
if it doesn't work for Telerik grid, how can I export multiple datatable to multiple tabs in excel template
ASKER
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