Opening page in Excel and linking styles.

C

Chris Dunaway

On my page, which is a simple report, I have a checkbox which will
cause the report to be opened in excel. I do this with the following
code in the button click:

if (chkViewInExcel.Checked)
{
Response.ContentType = "application/vnd.ms-excel";
Response.ContentEncoding = Encoding.Default;
Response.AddHeader("Content-Disposition",
"attachment;filename=ExcelReport.xls");
}

This seems to work ok if I have my styles inlined in the aspx page.
But if I use a <link> tag to load the stylesheet, then Excel complains
that it cannot find the style sheet. The path it gives is in my
documents and setting folder on the client. It doesn't seem to want
to load the styles from the web server.

Can anyone shed some light on this for me?

Thanks,

Chris
 

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

Members online

No members online now.

Forum statistics

Threads
474,344
Messages
2,571,432
Members
48,794
Latest member
massivestack

Latest Threads

Top