473,473 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Exporting Datagrid to Excel

Hi,

I found an very interesting article on converting Datagrids to Excel. I
apologize that I forgot the name of the author/article but it was very
helpful.

Problem:
it converts only the current page on the Datgrid to Excel and if there are
other pages it does not.

does anyone have an article or sample code that converts all data from
datagrid to Excel? i have like 10 pages and it does 1 only.

Thanks all,
Stephen
Nov 19 '05 #1
7 1402
"Stephen Noronha" <st********@hotmail.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
does anyone have an article or sample code that converts all data from
datagrid to Excel? i have like 10 pages and it does 1 only.


http://www.seriousfish.com/Home.aspx
Nov 19 '05 #2
http://www.carlosag.net/Tools/ExcelX...r/Default.aspx
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Stephen Noronha" wrote:
Hi,

I found an very interesting article on converting Datagrids to Excel. I
apologize that I forgot the name of the author/article but it was very
helpful.

Problem:
it converts only the current page on the Datgrid to Excel and if there are
other pages it does not.

does anyone have an article or sample code that converts all data from
datagrid to Excel? i have like 10 pages and it does 1 only.

Thanks all,
Stephen

Nov 19 '05 #3
You will likely have to use the Office SDK (Yuck, at least until the .NET
bits for 2003) or use a third party component. There is a free library here:

http://www.asp.net/ControlGallery/Co...977&tabindex=2

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Stephen Noronha" wrote:
Hi,

I found an very interesting article on converting Datagrids to Excel. I
apologize that I forgot the name of the author/article but it was very
helpful.

Problem:
it converts only the current page on the Datgrid to Excel and if there are
other pages it does not.

does anyone have an article or sample code that converts all data from
datagrid to Excel? i have like 10 pages and it does 1 only.

Thanks all,
Stephen

Nov 19 '05 #4
On Tue, 20 Sep 2005 10:01:09 -0700, "Stephen Noronha" <st********@hotmail.com> wrote:

¤ Hi,
¤
¤ I found an very interesting article on converting Datagrids to Excel. I
¤ apologize that I forgot the name of the author/article but it was very
¤ helpful.
¤
¤ Problem:
¤ it converts only the current page on the Datgrid to Excel and if there are
¤ other pages it does not.
¤
¤ does anyone have an article or sample code that converts all data from
¤ datagrid to Excel? i have like 10 pages and it does 1 only.

Technically not all of the data is *in* the DataGrid. You probably want to export from the
underlying data source which would be the DataSet or database.

http://www.dotnetjohn.com/articles.aspx?articleid=36
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 19 '05 #5
When exporting to Excel you should turn DataGrid paging off, that way it will
export the entire underlying dataset.

Here's more info:
http://SteveOrr.net/articles/ExcelExport.aspx
http://SteveOrr.net/articles/ExportPanel.aspx

--
I hope this helps,
Steve C. Orr
MCSD, MVP
http://Steve.Orr.net

"Stephen Noronha" wrote:
Hi,

I found an very interesting article on converting Datagrids to Excel. I
apologize that I forgot the name of the author/article but it was very
helpful.

Problem:
it converts only the current page on the Datgrid to Excel and if there are
other pages it does not.

does anyone have an article or sample code that converts all data from
datagrid to Excel? i have like 10 pages and it does 1 only.

Thanks all,
Stephen

Nov 19 '05 #6
Hi all,
thanks for the links to the articles and info.
Stephen

"Stephen Noronha" <st********@hotmail.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
Hi,

I found an very interesting article on converting Datagrids to Excel. I
apologize that I forgot the name of the author/article but it was very
helpful.

Problem:
it converts only the current page on the Datgrid to Excel and if there are
other pages it does not.

does anyone have an article or sample code that converts all data from
datagrid to Excel? i have like 10 pages and it does 1 only.

Thanks all,
Stephen

Nov 19 '05 #7
Or, you can just do it the easy way by giving a user a link to a page
that renders similar to the following -- let their copy of Excel do the
rendering:

<%@ Page Language="C#"%>
<script runat=server>
void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "application/vnd.ms-excel";
}
</script>
<table>
<tr>
<td><b>Column 1</b></td>
<td style="width: 300px;"><b>Column 2</b></td>
</tr>
<tr>
<td style="background-color: yellow; color: red;">Value</td>
<td>Another Value</td>
</tr>
</table>

-Alan

Nov 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Hideyuki | last post by:
Hi, I am using asp.net, and I am having a problem exporting datagrid to excel. One column contains numbers such as 123456875468. When this goes to excel, it is displayed as 1.23456E + 11 which I...
0
by: Amber | last post by:
I found a sample on dynamic reporting to a datagrid and exporting to excel. For those who are into reporting into Excel. This web tool allows for adhoc select statements and reports. ...
3
by: Andres Romero | last post by:
I have a button in my html page for exporting to excel files using the RenderControl function. When the table generated is small in rows size it works fine, but when there are much more rows (more...
5
by: Neil | last post by:
Hi I'm currently exporting my datagrid to excel, taking advantage of the fact that excel can render html, the problem is that when i click the button to export it opens in browser, I want the button...
1
by: ad | last post by:
I use the code below to export the content of a data set to Excel, the code come form http://www.dotnetjohn.com/articles.aspx?articleid=36 But it always use the web form's name as the default...
1
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream...
6
by: Opa | last post by:
Hi, I have a DataGrid, whose sourceI am exporting to Excel. This works fine except for the Column ordering. My datasource is not a datatable, with a typical SELECT statement where I can...
0
by: Sridhar | last post by:
Hi, I am having trouble renaming the excel sheet while exporting to excel. we have a datagrid that contains some analytical data. I have the name to the excel file as "temp.xls" inside the code....
4
by: Tom | last post by:
I have a gridview on all of my web pages in my web app and they all export to excel. I have one page where the gridview is binding to a datatable that i created and only the first column is...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.