Last post Oct 07, 2011 12:10 PM by icenvon
Sep 30, 2011 05:29 AM|icenvon|LINK
Hello, I have designed an application using visual studio and access as the database. I would like to be able to convert or print the information or tables shown in the gridview into pdf or microsoft excel so that the information can be eventually printed
out on hard copy. Appreciate the help.
Sep 30, 2011 05:37 AM|mkonanki|LINK
check below link for
gridview export excel
this is excel and pdf
Sep 30, 2011 05:47 AM|icenvon|LINK
THANKS A LOT!! Will try them and let you know how it goes, boss
Sep 30, 2011 01:06 PM|icenvon|LINK
Hi. I have been trying to convert a table in gridview in visual studio to excel. In my visual studio i have a griview with id Gridview4 and a button with id btnexport2. In the code behind for the button, this is what I have:
However, when I view in browser and click the button this is the error i get:
And the error message heighlights in red the line : GridView4.RenderControl(hw)
I don't understand this. I believe my content place holder is already within a form, so I don't understand the message.
However, when I remove the line: GridView4.RenderControl(hw), an excel sheet is created but there is no data within it.
Kindly help point out the issue with what I have done or rather HELP!!!
P.S the one from codeproject is too complicated and will be cumbersome for tens of pages that i have already made with at least two tables in each.
Oct 01, 2011 08:50 PM|Decker Dong - MSFT|LINK
Control 'ctl00_ContentPlaceHolder1_GridView4' of type 'GridView' must be placed inside a form tag with runat=server.
Hello, this error is due to it that you must override the "VerifyRenderingInServerForm" event. Just like this below:
public override void
// Confirms that an HtmlForm control is rendered for the
specified ASP.NET server control at run time.
Oct 07, 2011 12:10 PM|icenvon|LINK
Thanks a lot Decker