Solved

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

Posted on 2014-09-30
6
1,688 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 15

Expert Comment

by:Ess Kay
Comment Utility
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
Comment Utility
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
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now