Export Page to Excel. Missing CSS problem

S

Server Control

Hi,
I want to export an entire Page to excel. If I try to export the page
with Inline disposition:
Response.AddHeader("content-disposition", "inline;filename=abc.xls");
the css and formatting appears properly.
However, if I use "Attachment" type
Response.AddHeader("content-disposition",
"attachment;filename=abc.xls"); I get an error dialog : saying "Missing
File: C:\....\Style.css". It is unable to find the css files on my
page.
I need to open the excel in a new window. If anyone knows about this
problem, please let me know.
 
Joined
Feb 28, 2008
Messages
1
Reaction score
0
Solution for exporting css content to excel

i think excel file is not recognizing css format. So create a new jsp file and name it as Style.jsp and include all css content in this file under <style>

Your jsp file should look like this


<Style type="text/css">

<!--CSS content in .css file-->

</style>

Include Style.jsp in all the jsp files whereever you want to open the excel page using <jsp:include page="Style.jsp">

Remove the tag which imports .css file<link href=".css">

This should work.
 

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

Similar Threads

export to excel 1
export to excel 2
Export to excel !! 4
export to excel 0
Image shifts to the right when export the page to pdf 4
Export Datagrids to Excel 1
API to excel dont show data 0
export to PDF problem 2

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top