Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting Excel files with images

Status
Not open for further replies.

faeton13

Programmer
Mar 7, 2005
9
CO
Hi.
I'm developing a web application that uses Excel for printing the reports. So far everything has worked fine, at least for the created Excel files that do not have any images on them. Now I need to create an excel file with an image as the header. I tried adding the necessary code to include the image, but when I open it, the image is not displayed (like when you open an HTML page that could load a certain image). I tried using different ways to set the src to see if maybe the path was the problem, but everytime I got the same result...
How can I do this? How can I include the image and actually display it when the user opens the file in Excel?

Thanks in advance

Faeton 13
 
Hi,

Use image as a backgound for the header and spcify the URL of the image in CSS file and include the CSS file in the JSP page using <jsp:include>. I haven't tried the solution hopefully it will work.

ex: CSS file
Code:
<style>
 .img-src{
    background-image: url('images/icon_info.gif');
    background-repeat: no-repeat
  }
</style>

In JSP page
Code:
<html>
<head>
 <title>Test</title>
  <style><jsp:include page="aboveCSS.css"/></style>
</head>
<body>
<table width="42">
  <tr>
    <td width="36" class="img-src">&nbsp;</td>
  </tr>
</table>
</body>
</html>

Cheers
Venu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top