473,320 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

WTD: Simple Function to Export DataGridView to Excel

Dear all,

I'm sure someone has already done this, so as not to wish to re-invent the
wheel - and Google not turning up anything I can use, does anyone have a
suitable function into which I can pass a DataGridView - and have all the
columns and rows parsed and an Excel Workbook created with the DataGridView
contents and column headers transposed onto the first Worksheet?

Many thanks in advance!

Mike

Apr 5 '07 #1
2 4960
On Apr 5, 6:04 pm, "Mike Wilson" <liddlefeeshSorryNoS...@gmail.com>
wrote:
Dear all,

I'm sure someone has already done this, so as not to wish to re-invent the
wheel - and Google not turning up anything I can use, does anyone have a
suitable function into which I can pass a DataGridView - and have all the
columns and rows parsed and an Excel Workbook created with the DataGridView
contents and column headers transposed onto the first Worksheet?

Many thanks in advance!

Mike
Check this article
http://www.codeguru.com/forum/archiv.../t-411456.html

--NA

Apr 5 '07 #2
<mn************@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
On Apr 5, 6:04 pm, "Mike Wilson" <liddlefeeshSorryNoS...@gmail.com>
wrote:
>Dear all,

I'm sure someone has already done this, so as not to wish to re-invent
the
wheel - and Google not turning up anything I can use, does anyone have a
suitable function into which I can pass a DataGridView - and have all the
columns and rows parsed and an Excel Workbook created with the
DataGridView
contents and column headers transposed onto the first Worksheet?

Many thanks in advance!

Mike

Check this article
http://www.codeguru.com/forum/archiv.../t-411456.html
Many thanks - helpful article.

M

Apr 6 '07 #3

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

Similar topics

13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
0
by: artteam | last post by:
Hi All, I try to export the table in DataGridView control on my form to MS excel with the following code. private void fnExtractToExcel() { ...
5
by: Mike Wilson | last post by:
Hello all, I'd like to export a DataGridView to Excel. I am using .NET 2.0 and VB.NET. But I don't know if the user has Excel on their machines, so can't use COM Excel object. Any ideas...
0
by: nitin005 | last post by:
I have to export the data present in the datagridview to Microsoft Excel. It is a window application using c#. Does anyone know how to do it. Please help. Thanks
19
by: cj2 | last post by:
#1 Is there a quick way to export a datatable to an excel file? Or delimited file? #2 Where is the appropriate Microsoft monitored group to ask about writing reports in SQL Reporting services...
2
by: ISATownsME | last post by:
Hello, I have a program that loads a datagridview from excel to visual studio. Can anyone tell me how to export the cell values of the datagridview to my access database?
2
by: Narz1986 | last post by:
hi...i m trying to export data from the datagrid to excel...here is my code HttpContext.Current.Response.Clear(); HttpContext.Current.Response.AddHeader("content-disposition",...
1
by: jgabrielson | last post by:
Hello All, I have a windows application that exports data from a datagridview into excel. Now this data can change based on what a user does in the datagridview itself. An example would be out of...
1
by: 127mohit | last post by:
Hi all, I have a simple code that exports an HTML table on an ASP page to excel. The code works fine, however if the original text in the HTML table had a particular colour, it is not exported in...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.