G
Guest
Hi,
Basically, I want to create excel file on the fly, then force users to
download it
without using automation.
Here is one of ways..
System.IO.StringWriter sw = new System.IO.StringWriter();
......
Response.Clear();
....
...
Response.Buffer= true;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
Response.AddHeader("Content-Disposition","attachment; filename=test.xls" );
Response.ContentEncoding = System.Text.Encoding.Default;
.....
.....
sw.WriteLine(...
//Write header
........
....
sw.WrihteLine(...
//Write content
.....
sw.Flush();
Response.End();
It works great, but one issue came up I need to solve...
I want to create ONE excel file that contains SEVERAL WORKBOOT SHEETS such
as Sheet1, Sheet2 and Sheet3....I think I can do this with automation, but
can't think of how it can be done without COM automation.
If using above code, it only creates one workbook sheet......
Again,
How do I create ONE excel file that contains SEVERAL SHEETS WITHOUT using
automation?
Thanks.
..................................................................................TJ
Basically, I want to create excel file on the fly, then force users to
download it
without using automation.
Here is one of ways..
System.IO.StringWriter sw = new System.IO.StringWriter();
......
Response.Clear();
....
...
Response.Buffer= true;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
Response.AddHeader("Content-Disposition","attachment; filename=test.xls" );
Response.ContentEncoding = System.Text.Encoding.Default;
.....
.....
sw.WriteLine(...
//Write header
........
....
sw.WrihteLine(...
//Write content
.....
sw.Flush();
Response.End();
It works great, but one issue came up I need to solve...
I want to create ONE excel file that contains SEVERAL WORKBOOT SHEETS such
as Sheet1, Sheet2 and Sheet3....I think I can do this with automation, but
can't think of how it can be done without COM automation.
If using above code, it only creates one workbook sheet......
Again,
How do I create ONE excel file that contains SEVERAL SHEETS WITHOUT using
automation?
Thanks.
..................................................................................TJ