Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-09-30
6
Medium Priority
?
1,954 Views
Last Modified: 2014-10-01
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.
0
Comment
Question by:Raj G
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:Ess Kay
ID: 40352342
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
0
 

Author Comment

by:Raj G
ID: 40352466
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.
0
 
LVL 15

Accepted Solution

by:
Ess Kay earned 1000 total points
ID: 40352501
From the telerik website:

Such a functionality is not supported by the RadGridView export mechanism



source:http://www.telerik.com/forums/excel-export-in-existing-excel-file
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:Ess Kay
ID: 40352515
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
0
 

Author Comment

by:Raj G
ID: 40353362
if it doesn't work for Telerik grid, how can I export multiple datatable to multiple tabs in excel template
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question