473,406 Members | 2,390 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,406 software developers and data experts.

exporting datagrid to excel Exception pb

Hello,
I try to export a datagrid into a excel files,
I've read the help there:

http://www.codeproject.com/aspnet/DA...ortToExcel.asp
I've copied the code
but i receive this exceptionException:

Control 'dgDowntime_ctl02_ctl00' of type 'DataGridLinkButton' must be
placed inside a form tag with runat=server.

event if the datagrid is inside a form with runat=server...
<form id="Form1" method="post" runat="server">
<asp:DataGrid ID="dgDowntime" runat="server" Width="100%" .....

What am i missing?
Thank you!

Nov 19 '05 #1
2 1047
Post the entire tag
"Franck" <fh@fh.com> wrote in message
news:dg**********@s1.news.oleane.net...
Hello,
I try to export a datagrid into a excel files,
I've read the help there:

http://www.codeproject.com/aspnet/DA...ortToExcel.asp
I've copied the code
but i receive this exceptionException:

Control 'dgDowntime_ctl02_ctl00' of type 'DataGridLinkButton' must be
placed inside a form tag with runat=server.

event if the datagrid is inside a form with runat=server...
<form id="Form1" method="post" runat="server">
<asp:DataGrid ID="dgDowntime" runat="server" Width="100%" .....

What am i missing?
Thank you!

Nov 19 '05 #2
Jan
Control your are referring to is probably not working because HTML you
are sending to MS Excel is too specific.

However, you have other free alternatives. For example, ExcelLite Free
is a free .NET component that can read / write both XLS and CSV files.
You can use it in a commercial applications; it is only limited to max
150 rows per sheet. You can download it here:
http://www.gemboxsoftware.com/ExcelLiteFree.htm

Jan
GemBox Software
http://www.gemboxsoftware.com

Franck wrote:
Hello,
I try to export a datagrid into a excel files,
I've read the help there:

http://www.codeproject.com/aspnet/DA...ortToExcel.asp
I've copied the code
but i receive this exceptionException:

Control 'dgDowntime_ctl02_ctl00' of type 'DataGridLinkButton' must be
placed inside a form tag with runat=server.

event if the datagrid is inside a form with runat=server...
<form id="Form1" method="post" runat="server">
<asp:DataGrid ID="dgDowntime" runat="server" Width="100%" .....

What am i missing?
Thank you!


Nov 19 '05 #3

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

Similar topics

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...
2
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform...
2
by: Kenny M. | last post by:
Hi I'm using the code shown here to export only my DataGrid to Excel. http://www.c-sharpcorner.com/Code/2003/Sept/ExportASPNetDataGridToExcel.asp In my page I have two DropDownListBox, two...
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: kanepart2 | last post by:
Hi , I have the following code to export a datagrid to excel Public Sub ExportToExcel(ByVal dt As DataTable) Try Dim oApp As New Excel.Application Dim oBook As Excel.Workbook =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
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...

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.