Any way to create two sheets in same excel file?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top