tag:blogger.com,1999:blog-3893582346020662759.post3359072480664743338..comments2024-03-02T10:24:11.056+05:30Comments on SharePoint, ASP.Net, JQuery, SQL Solutions: GridView and export to excelAnonymoushttp://www.blogger.com/profile/11277148819153438060noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-3893582346020662759.post-91117931189004733322013-05-16T07:36:51.687+05:302013-05-16T07:36:51.687+05:30hi,
how to add verifyrenering method to aspx page...hi,<br /><br />how to add verifyrenering method to aspx page as of first solution..........sharepointhttps://www.blogger.com/profile/00696539738835455517noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-34159002285801715912013-02-13T00:56:38.510+05:302013-02-13T00:56:38.510+05:30Error:
VerifyRenderingInServerForm(System.Web.UI.C...Error:<br />VerifyRenderingInServerForm(System.Web.UI.Control)': no suitable method found to override....<br /><br />Fix #1: as mentioned above.<br /><br />Fix #2: in the usercontrol just create a form with runat attribute for your grid to export using the following:<br /><br /> StringWriter sw = new StringWriter();<br /> HtmlTextWriter htw = new HtmlTextWriter(sw);<br /> <br /> // Create a form to contain the grid<br /> HtmlForm frm = new HtmlForm();<br /> frm.Attributes["runat"] = "server";<br /><br /> gv_to_export.Parent.Controls.Add(frm);<br /> frm.Controls.Add(gv_to_export);<br /> frm.RenderControl(htw);<br /><br /> Response.Write(RemoveSpecialTags(sw));<br /><br />Followoing is the RemoveSpecialTags Method:<br /><br />private string RemoveSpecialTags(StringWriter sw)<br /> {<br /> string ret = "";<br /> ret = Regex.Replace(sw.ToString(), @"", "", RegexOptions.IgnoreCase);<br /> ret = Regex.Replace(ret, @"[\s\S]*?", "", RegexOptions.IgnoreCase);<br /> ret = Regex.Replace(ret, @"[\s\S]*?", "", RegexOptions.IgnoreCase);<br /> ret = Regex.Replace(ret, @"<[^>]+?/[ ]*>", "", RegexOptions.IgnoreCase);<br /><br /> return ret;<br /> }<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-3721911637056378582012-10-11T00:46:42.009+05:302012-10-11T00:46:42.009+05:30Check out for ASP.net development.Check out for <a href="http://www.labsdigital.com" rel="nofollow">ASP.net development.</a>Danish Khanhttp://www.labsdigital.comnoreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-42124834384082438132012-04-17T15:05:44.921+05:302012-04-17T15:05:44.921+05:30Hi Shalini,
Data Source is the data grid only. che...Hi Shalini,<br />Data Source is the data grid only. check its binding correctly..Sivahttps://www.blogger.com/profile/05701629376566515138noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-41223953210550406152012-04-04T03:10:20.655+05:302012-04-04T03:10:20.655+05:30Hi Praveen, Thanks for creating such a detailed ar...Hi Praveen, Thanks for creating such a detailed article on all the possible errors. Literally I faced all the errors one by one. <br />I am now faced with the problem what Basam faced earlier. The excel contains empty divs. Not sure what you meant by comment "data source is coming empty"? Since I am able to view the datagrid.<br />Thank youShalininoreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-66464203762605074802011-10-06T13:15:14.762+05:302011-10-06T13:15:14.762+05:30YEAH THIS IS THE CORRECT ANSWER, IT EXPORTS NOW MY...YEAH THIS IS THE CORRECT ANSWER, IT EXPORTS NOW MY PARENT AND CHILD GRIDVIEW TO MSEXCEL. NICE CODES THANK U (^^,)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-90477885402252566952011-06-29T14:17:47.935+05:302011-06-29T14:17:47.935+05:30Hi Vicky,
Yes this is expected issue. The problem ...Hi Vicky,<br />Yes this is expected issue. The problem is, the method VerifyRenderingInServerForm is page method. So, you should override that in your ASPX page. Below are the scenarios considered:<br />1. If user control is in less number of pages[Means less than 5 pages] then please add the method "VerifyRenderingInServerForm" in each and every page.<br />2. If user control is in use more than 4-5 pages then I always suggest you to create a base page [A class which inherits from System.Web.UI.Page] and in that add this method "VerifyRenderingInServerForm". And all your ASPX pages will inherit this base page and problem resolved.<br /><br />Let me know if you have any more questions.Anonymoushttps://www.blogger.com/profile/11277148819153438060noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-6294414641539447242011-06-29T13:02:51.122+05:302011-06-29T13:02:51.122+05:30Hi Praveen i have try this code but it showing the...Hi Praveen i have try this code but it showing the error because i am using this code in webusercontrl.ascx page<br />Error:<br />VerifyRenderingInServerForm(System.Web.UI.Control)': no suitable method found to override....Vickyhttps://www.blogger.com/profile/01158954901914851680noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-84793264666635433882011-06-29T12:50:32.577+05:302011-06-29T12:50:32.577+05:30Hi Praveen i have try this code but it showing the...Hi Praveen i have try this code but it showing the error because i am using this code in webusercontrl.ascx page<br />Error:<br />VerifyRenderingInServerForm(System.Web.UI.Control)': no suitable method found to override....Vickyhttps://www.blogger.com/profile/01158954901914851680noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-85190468200753459122011-04-22T18:43:01.353+05:302011-04-22T18:43:01.353+05:30I tried your code and the errors disappeared but n...I tried your code and the errors disappeared but no Excel appears.<br />Do you know why?<br />NB: I'm using Google Chromethemogahttps://www.blogger.com/profile/12337419838935973030noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-48169380873104981982011-02-17T10:52:08.101+05:302011-02-17T10:52:08.101+05:30YES,with a open office support.YES,with a open office support.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-7513009673708603222011-02-16T17:44:11.670+05:302011-02-16T17:44:11.670+05:30You meant to say Excel in native format?You meant to say Excel in native format?Anonymoushttps://www.blogger.com/profile/11277148819153438060noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-85864113637642438342011-02-16T17:38:13.418+05:302011-02-16T17:38:13.418+05:30Hi,
I need to generate an excel sheet which has to...Hi,<br />I need to generate an excel sheet which has to be compatible with Open Office Excel as well.<br /><br />Does your code support this feature.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-28005573292113172712011-01-27T16:56:30.120+05:302011-01-27T16:56:30.120+05:30What the error you are seeing? Are you able to dow...What the error you are seeing? Are you able to download EXCEL? or The excel sheet is not opening at all?Anonymoushttps://www.blogger.com/profile/11277148819153438060noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-63741969260243331032011-01-27T16:49:10.406+05:302011-01-27T16:49:10.406+05:30i tried your code.. no errors.. but still not open...i tried your code.. no errors.. but still not opening the excel sheet.. where i went wrong,,<br />plese suggest me..Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-56721607582853555192010-12-17T02:00:26.785+05:302010-12-17T02:00:26.785+05:30Hi Basam,
Seems like the data source is coming emp...Hi Basam,<br />Seems like the data source is coming empty. Please check once the data source you are using have the data by the time your Excel click logic is executing. Debug and let me know.Anonymoushttps://www.blogger.com/profile/11277148819153438060noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-59728476961708537602010-12-17T01:54:30.433+05:302010-12-17T01:54:30.433+05:30Praveen, I tried your code. But it doesn't giv...Praveen, I tried your code. But it doesn't give any error. All I see in the excel file that got created is only div element.<br /><br />Any idea why this could be happening?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-87701378897217739792010-12-11T05:06:46.124+05:302010-12-11T05:06:46.124+05:30Seems like you forgot to put the code mentioned in...Seems like you forgot to put the code mentioned in #1. Read complete post and add the code mentioned. Your error will go away.Anonymoushttps://www.blogger.com/profile/11277148819153438060noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-22798672098481623722010-12-11T00:28:45.638+05:302010-12-11T00:28:45.638+05:30Thanks a lot for sharing this code, but after usin...Thanks a lot for sharing this code, but after using your code i got again error..<br /><br />Error 1 VerifyRenderingInServerForm(System.Web.UI.Control)': no suitable method found to override....Nagesh Chowdary Manukonda https://www.blogger.com/profile/12042281128972181275noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-41148509942329454672010-09-29T12:08:16.812+05:302010-09-29T12:08:16.812+05:30I am glad to hear this. Thank you very much for su...I am glad to hear this. Thank you very much for such a good comment.Anonymoushttps://www.blogger.com/profile/11277148819153438060noreply@blogger.comtag:blogger.com,1999:blog-3893582346020662759.post-2818528926967703102010-09-29T11:51:23.274+05:302010-09-29T11:51:23.274+05:30I was in search of this code since from many days,...I was in search of this code since from many days, and glad to have found it here. Thanks a lot for sharing this code. I like your post and would like to share it with others.asp.net ecommerce developmenthttp://www.ydeveloper.com/asp-dot-net-ecommerce.htmlnoreply@blogger.com