473,668 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP - Excel - Images

blyxx86
256 Contributor
I was having issues with exporting an ASP table that included images. I have since found a solution for this error, and hope that what I have found becomes useful for some others on this site.

At the top of the page:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. Response.ContentType = "application/vnd.ms-excel"
  3. Response.AddHeader "Content-Disposition", "attachment; filename=MyReport" & ".xls"
  4. %>
  5.  
Then the part that had the image in the main HTML/ASP script used to look like this:
Expand|Select|Wrap|Line Numbers
  1. <img src="/images/custlogo/<%=rs("LogoName")%>" title="<%=rs("Customer")%>"/>
  2.  
Now I replaced the relative path with the full path:
Expand|Select|Wrap|Line Numbers
  1. <img src="http://www.mysite.com/images/custlogo/<%=rs("LogoName")%>" title="<%=rs("Customer")%>"/>
  2.  
After making this change it fixed the problem of showing up a 'blank' placeholder in the excel spreadsheet.

I hope this helps fix any issues that others may have encountered. :)
Jan 22 '08 #1
0 1094

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2064
by: Balamurali C | last post by:
Hi All I'm having one problem, since im debuging this last one week I'm not able to do. Problem: In my webage I have two Frames(top & bottom) in the top frame I'm displaying some images(logo...etc) and bottom frame I'm displaying some document(excel,word,ppt,pdf etc...)which are working fine. when I take print, using IE-File-menu (IE->File->print) when excel document
0
1167
by: jhgonzales | last post by:
The datagrid is exporting but without the images. When the file is downloaded, it seems that the excel file was supposed to have the images because they appear as "broken" image in the file. This is the abbreviated approach that I am currently using. Response.Clear() Response.Buffer = True Response.ContentType = "application/vnd.ms-excel" Response.Charset = ""
0
5692
by: Jedawi | last post by:
Hi, would anyone be able to point me in the right direction on how to import an image (.jpg file) into an Excel worksheet using VB.Net and Option Strict On. This should be straight forward however with Excel returning some weak-typed objects we are having problems. The only problem we have is with line (full code below) oExcel.ActiveSheet.Pictures.Insert("C:\Images\AB1.jpg").Select()
2
2260
by: Yaseen D M | last post by:
I have aspx page which contains some gif, jpg and png images. PNG image is generated dynamically. This file is basically a graph image. The problem i am facing in exporting these images to word, excel and pdf. Is there anyway to export these images in ASP.NET I need solution urgent. Regards,
1
1103
by: joy | last post by:
Hi. I have a datagrid which displays images in cells. User wants to download the grid data as excel file. Now, if datagrid contains only data, it is fine. But if it contains some images, images are not displayed in the excel.is it possible to display...
1
3362
by: edwinparker | last post by:
Hi, I'm trying to convert a gridview to an excel report and have one small hang up. So far I've been able to create my gridview and export it to excel ok, but in my gridview I have an image. The problem is, the image won't display unless I'm connected to the Internet or if I use a relative path and have the image stored relative to the excel file. Is it possible to "embed" the image from the gridview into the excel workbook so I could give...
1
2105
roswara
by: roswara | last post by:
Dear all, Currently, I am working on a project to make a web-based application using ASP 2.0 and C#. This application will ask user to input for an excel file which has graphs in it. Then the application will grab the graph as image file, and this image will be displayed as thumbnail in the page. Is it possible to accomplish this feature? If it is possible, would you please tell me how? And if it is not possible, why?
6
8065
by: Eddie | last post by:
Hi all, I am displaying a number of reports, and giving the users an option to display them on the web or download them to Excel. If they want the Excel file, I just use the PHP header command to change the Content- Type and Content-Disposition headers, and essentially print the same report, and it's done. That works fine. But in some reports on the web I need to show images. The web part is fine, but I'm having a tough time...
0
2241
by: JRough | last post by:
Hi, I have a page with a form that is included into a php page. It has some php variables which are headers based on the user choices. In the form I will send some mysql data columns but right now I'm just formatting the form inside the tables. I added the table with the form yesterday and a button. After the data comes from php server I want the user to be able to click the Excel button at the bottom and the form output will go to...
2
3844
by: Kevin G. | last post by:
Hello, I'm exporting an ASP page to Excel using 'Response.ContentType = "application/vnd.ms-excel"' and it is working fine for the most part except the particular page I'm exporting has images, and no matter what style/alignment/etc. that I provide to the <tdtag that contains the <imgtag, it always left-aligns the image in the Excel cell. Has anyone had any success with controlling the alignment of images when exporting from ASP to...
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.