Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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,916 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

722 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