Exporting data from web form to excel file

I have a page with datgrid and one button called export into excel.

I use this code to export data into excel sheet. If my excel file size become more then 50k then i am having error and i can not open or save the excel file.

Here is the code:

 Server.ScriptTimeout = 12000
 Response.ContentType = "application/vnd.ms-excel"
 dvwdetail = GetSQLData(VSQL)
 grdapex.DataSource = dvwdetail.Tables(0)
 grdapex.DataBind()

If i have less row means the excel file size is less then 50k then it works fine but if i have more data file size is more then 50k then it give me error message.

Unable to read file. How can i resolve the problem so if i have more that still it open into excel. Is there any setting i have to do in order to achive my task.

Thanks.

0
drpkrupa
12/4/2006 3:23:06 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

2 Replies
534 Views

Similar Articles

[PageSpeed] 58

I have one more qestion regarding datagrid control. I have a column on grid and i am binding that header column on itemdatabound event. Here is the code:

 Protected Sub grddetail_ItemDataBound (...... )                  
Select Case e.Item.ItemType
 Case ListItemType.Header
                e.Item.Cells(7).Text = "<a onclick=window.open('Export.aspx?dealer=<%=lbldealerno.Text%> + &amp;pmtdate=<%=lblpmtdate.Text%>','cal','width=700,height=600,left=150,top=50') href='javascript:;'><img src='Images/excel.ico'></a>"
End Select

It works fine if i remove the paramerter value. <%=lbldealerno.Text%>. What is wrong with this tag.

0
drpkrupa
12/4/2006 4:26:51 PM

Any update please.

 

Thanks

0
drpkrupa
12/4/2006 10:38:38 PM
Reply:

Similar Artilces:

Submitting data from a know web form to unknown web form
hi i m making a software in which i will submitt some data from a web page that will go to a web form of which contrlos are unknown to me only i know the name and how many controls in that form it means i can see the form only. how can i do this please help me soon with code plz its very argent.i m doin this wit the help of foxtrot.xray.WebRobot but its giving me error that this dll file is already exists in The file ('C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\_foxtrot.xray.WebRobot.dll' already exists).i don know what will do so please help me soon please thanks praveen We ca...

synchronizing chunk of data of one web form for another web form
I'm making a web application. In one web form; i'm taking inputs from user. Now; there is some info given by user in this page which is needed for web form which is going to be displayed next. i want to display that info automatically on that web form so that user doesn't have to re-input that info in this next web form. Info from first page would be inserted into database when user clicks on the submit button. then that next web form would be displayed. and the chunk of info from previous page should be displayed there!!! how can i do this?? cany anybody help?? nobody can help me!! I...

WEB FORMS and datasetS (do I have to repeat the file definition in every web form?)
I am working on vb.net.I have a project with 35 web forms and an access file with 18 tables.Until now I have defined the oledbadapters in every form by dragging the tables from the server explorer tool box.This is not a good idea because every time that I make a change on the database design I have to drag the new definition on 35 web forms and I have to create the datasets again. This is boring and time consuming!The question is:WHAT CAN I DO TO HAVE THE FILE DEFINITION ONLY IN ONE PLACE AND THAT EVERY WEB FORM WOULD TAKE THE DATA ADAPTERS AND DATASETS FROM THERE? how about if you write a...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

How to Make Web Forms from other Web Forms
In putting together an ASP.NET application for a biz application, we have come to the point where there are three different types of basic forms which have, for the most part, been perfected. Now its is a matter of cloning those forms for various uses and modifying or adding code to suit the particular need. Copy and paste works OK, but there is a lot of changing of certain words, etc. Is there a way in ASP.NET to take these basic forms, turn them into classes or templates, create forms from them, then add or overwrite code? ? (Anybody who is a Vis Fox Pro programmer would know imme...

Export data from web form to excel -- using client's excel app
I am currently trying to figure out if there is any way to export data to the client's excel app. I do not want to use the web server's excel application as it is cutting into the site's performance. Is there any way to use something similar to the what is included below (ExportComponent.vb), but to use the client's excel app? Imports System.Drawing.Color Public Class ExportComponent Inherits System.ComponentModel.Component Public Shared Sub DataToExcel(ByVal dgData As DataGrid, ByVal response As HttpResponse) response.Clear() response.Charse...

Exporting data from a web form to a rtf file
I have searched all the knowledge base articles on Microsoft site and I haven't been able to find anything on that. Is it actually possible to export the webform on the user's computer in a custom format? Thanks! Not automatically (at least not out-of-the box), the easiest way is to add the ContentType to some specific editor, say Word or Excel, and then in the client machine, it will try to open it and the user can save it in the format he needs. I've seen some XSLT that can transform XML to PDF or RTF and other formats. In the upcoming version of Word, you can use WordML, and re...

Reading Excel Files from a .Net Web Form
Hi, This might be a dumb question, but ... When reading an Excel file from a .Net Web Form, is it necessary to have Microsoft Excel actually installed on the client machine running the web form? Also, do the Excel files being read need to be saved as "values only" or can the values be extracted from a spreadsheet where the cells contain formulas? Thanks. -Wayne Hi, For the 1st part, Office is not necessary to be installed. But Download the Office XP PIAs and use them to develop Office XP solutions with Visual Studio .NET. For 2nd Part I think you need to use Values.Regar...

For interrupting.web form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form
Web Form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form ! Because of my pool English, if you can't see , I will explain more ! ThanksGambler is the real life I guess you mean when form grows it also grow parent div element. This is normal. If you want div to stay fixed size and rather clip the form and maybe show a scrollbar, look at overflow property in CSS.Thanks------------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no ...

Include web form inside web form
I tried to include an aspx file in a asp.net web form. However, all the web controls (textbox, button) in the included page are not displayed when called. <Form id="Form1" method="post" runat="server"> <%   Response.writeFile("subPage.aspx"); %> <asp:button id="btnPrev" runat="server" text="Previous"></asp:button> </Form> There are some <asp:textbox> controls in the subPage.aspx file, the file itself works fine, but when it is included in the main page, all the controls are not displayed. Please assist. Thanks   u should u...

calling a web form from another web form
I would like to know what is the best way to open a web form from another web form. I would like to call it from a button control. Thanks Well, if I've grasped your question right, there are many methods to do that: 1)Response.Redirect > To navigate to another page from code and is equal to clicking a hyperlink. I suggest this as I think it's closer to your question. 2)Server.Transfer > This ends the current web form and begins a new web form. It's usable when you want to pass some variables i.e (Label1.Text) to the next immediate page. It's not safe though and not used to send p...

Web Form vs. Web Content Form
If you don't mind, I would like to know what is the difference between those two items, when I go to add a new item I see both of those and I don't know what the difference is.  A content form is for use with a masterpage. A web form is a standalone web page. If you select web content form, you will then have to specify a masterpage for it. and what is a master page used for?  Hi, a master page is used to give a constant look and theme to a site, without having to duplicate code. So basically you can put your header, menu, nav and footer on a master page. Then a...

How to fire events in other web form from other web form ?
Suppose that I have A and B web form. I want to trigger B web form's Page_Load event from A web form. How can I do that ? Thanks in advanced WilbertWilbert Bujn Create a public method in B that call the load method : public void Load(object sender, System.EventArgs e) { Page_Load(sender, e) ; } In the page_load of A, instanciate a B object and then call the function B myB = new B() ; myB.Load() ; Quicky Thank you quicky, it works fine. WilbertWilbert Bujn...

Web Form embedded in another Web Form
Hi,  I have programmed a Web Form which acts like a scientific calculator. I would like to embedd this calculator in the upper left hand corner of another accounting Web Form. I don't want to host the calculator on the same server as the accounting page. I.e. I want them to have distinct URLs. Classically, I would do this using frames, but is there a better way using ASP? Is there some sort of Panel which can display the webpage at a specific URL which I can just drag onto my accounting Web Form? Thanks,  P1000   Frames are the only way to embed a webform inside ano...

Web resources about - Exporting data from web form to excel file - asp.net.web-forms

Gas Exporting Countries Forum - Wikipedia, the free encyclopedia
The Gas Exporting Countries Forum ( GECF ) is an intergovernmental organization of 11 of the world's leading natural gas producers made up of ...

Facebook Updates Comments Box Plugin With Comment Exporting and Larger News Feed Stories
Facebook today released several updates to the newest version of its Comments Box social plugin for third party websites that will increase the ...

Lower dollar a boon for Canberra's wine exporting king
It may mean more expensive holidays for some, but one ACT registered company has enjoyed a profitable time thanks to the sharp fall in the Australian ...

Irish plant shut for exporting horsemeat
Sky News is Australia's leader in 24-hour news.

New online freight marketplace Cargohound aims to be the Uber of exporting
Cargo Hound wants to revolutionise the way goods are shipped from Australia.

Exporting the desperate; out of sight ... and mind
The boats have stopped, the point's been made, so why continue to treat those already ''here'' with such unconscionable cruelty?

Meat market: Andrew Forrest sees fortune in exporting beef to China
China is so desperate for good beef that Australian billionaire Andrew Forrest will be taking sample parcels of steak in his luggage on his next ...

Exporting carbon and hypocrisy: our big growth industry
Never mind our modest cuts to local emissions, new research shows Australia is heading into a carbon export boom.

Montreal men accused of illegally exporting railway equipment to Iran
Two Montreal men are charged with illegally exporting American-made railway equipment to Iran, violating Canada's Export and Import Permit Act ...

Lee Specialties Ltd. Charged With Exporting Prohibited Commodity To Iran
CALGARY - Putting the wrong address on a $15 shipment of synthetic rubber rings has cost an Alberta company $90,000 for violating legislation ...

Resources last updated: 12/6/2015 6:10:45 AM