Solved

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

Posted on 2014-09-30
6
1,743 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 500 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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
 

Author Comment

by:Raj G
ID: 40354714
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 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