Create excel file from dataset and download to client






















Wael Dalloul Wael Dalloul This format is a bit harder than implied in above code, so you might just want to take a closer look ClearContent ; Response. AddHeader "content-disposition", attachment ; Response. RenderControl htw ; Response. Write sw. ToString ; Response. End ;. Muhammad Akhtar Muhammad Akhtar It is just like opening a text file with Excel — Jebli. Joe Erickson Joe Erickson 6, 1 1 gold badge 29 29 silver badges 31 31 bronze badges.

Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Who is building clouds for the independent developer? I hope you have created the same type of table. Now create the project as:. Now create the following function to create an Excel File from the database as in the following:. We have created the preceding function to create an Excel File from the database.

Now call the preceding function on the Create Excel File button click as in the following:. Generic; using System. Linq; using System. Web; using System. UI; using System. WebControls; using System. Data; using System. IO; using System. Configuration; using System. ConnectionStrings[ "getconn" ]. Fill ds ; GridView1. You might find the ReportViewer Control intresting. It's all based on the design of the report.

It's very fast, but I haven't tried it out with that many records. If you try it out, please let me know the result [: ]. Thank you very much for your instant reply and suggestions. I was out for training for last 5 days and now back in the office. I am back after long pause.

I am trying the solution you had suggested me last time. I am trying to use ReportViewer in my solution. I haven't got anything in which they are saying ok bind the report runtime by using Generic List or DataSet.

The content you requested has been removed.



0コメント

  • 1000 / 1000