Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Export to excel C#

Author  Topic 

reenz
Starting Member

29 Posts

Posted - 2006-03-29 : 06:15:22
I currently have a datagrid that will export to excel when i click a button. However what should i do when it is larger then 65k (max of a excel worksheet)?

Can anyone teach me how to export to multiple worksheets of the same excel file?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-03-29 : 06:25:08
how are you exporting to excel? there is usually an object collection named spreadsheets or similar that you can add to.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

reenz
Starting Member

29 Posts

Posted - 2006-03-29 : 06:31:42
im using datagrid and the following codes

Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
myDataGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();


Don't see any spreadsheet objects... =(
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-03-29 : 10:27:31
look into office web controls = OWC11
use them for anything word/excel related and doing it on the web.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

russellsoft

9 Posts

Posted - 2006-04-05 : 13:29:47
You can also use Jet provider for connecting to Excel-file as to database table...

Search by keywords "Jet Excel"
Go to Top of Page

Babaksql
Starting Member

32 Posts

Posted - 2006-04-08 : 00:54:15
Hi,
I install that, but I dont really know how to use them?
There are not any new component in my WebDeveloper 2005 Toolbox

Cheers
Go to Top of Page
   

- Advertisement -