asp excel download

pr_r
pr_r used Ask the Experts™
on
hi all
i have to create an excel file and force download that page. i have used the
fiollowing code
<% Response.Buffer=true
Response.ContentType = "application/vnd.ms-excel"
 Response.AddHeader "Content-Disposition", _
      "attachment; filename=MRExcelreport.xls"
      Response.Flush()%> and it works fine
but i have a css in that asp file
     <link rel="stylesheet" href="../int1.css">
when i click on the button excel from another file which links to the above coded file.and it shows a dialog asking me whether to save or open when i save it is telling CSS is missing
how can i resolve this?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Does the download works if you remove the <link...>?

hongjun

Author

Commented:
it is working
bu t telling that c://......./int1.css file is missing

Author

Commented:
it is working
bu t telling that c://......./int1.css file is missing
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Can you post all your code? Is your int1.css really exist and is in 1 level higher ../?

hongjun

Author

Commented:
if i take out response.content type and all it s displaying perfectly.
Can you post all your code?

Author

Commented:
it contains some 2000 lines. it is very difficult
let me try cut it and paste. i will do it tomorrow

Author

Commented:
    when i save excel i saving..
when i double click excel message shown is like this.
I want the same html format in excel also
c:\winnt\profiles\pr\int1.css missing
Please do not paste the 2000 lines. Perhaps other experts will be able to help you.

hongjun

Author

Commented:
i want to cancel this question how will i do this
Post a zero point question to Community Support Topic Area and post to request to delete http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20434660.html and a EE moderator will do the deletion for you.

hongjun

Commented:
What I figure out of your problem is that you are getting a file(Excel) downlaoded which in turn has a dependency on CSS. The CSS has to be downladed first and the path link for CSS in the Excel needs to be correct.
Mark FranzProject Manager

Commented:
Using this; Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", _
     "attachment; filename=MRExcelreport.xls"
does not require a .css page.  Basically all you are calling is a script to open a dounload file dialog box, there are no style properties available in the dialog box.

Author

Commented:
let me explain
i have apage mrexcelreport.asp

in that i have given the code.
<% Response.Buffer=true
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", _
     "attachment; filename=MRExcelreport.xls"
     Response.Flush()%>
and rest all the asp coded which needs to be exported....
and in that inside the body tag there is
 <link rel="stylesheet" href="../int1.css">


and when i run this page a dialog box opens asking save or open. when isave it is savcing fine in destop. when i doubleclicked on the saved xsl file it is telling c:=winnt\profiles\pr\int1.css is missing
Mark FranzProject Manager

Commented:
Why are you exporting asp code when all you need to export is a .xls file?  

Post the whole page code.
A request has been made to delete this question; if there are no objections within 72 hours, the request will be granted.

EXPERTS: Please leave your comments regarding this issue here.

Netminder
EE Admin
No problem
Commented:
PAQ'd and points refunded

modulo

Community Support Moderator
Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial