473,287 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

ASP to Excel Image Alignment Problems

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 Excel using
'Response.ContentType = "application/vnd.ms-excel"'? If so, would
you
be willing to share your secret?

Thanks in advance!

Kevin G.
Oct 1 '08 #1
2 3821

"Kevin G." <Ke***********@gmail.comwrote in message
news:42**********************************@64g2000h sm.googlegroups.com...
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 Excel using
'Response.ContentType = "application/vnd.ms-excel"'? If so, would
you
be willing to share your secret?
Create a Workbook yourself as you would ideally have it, then save it as a
web page. You can open the resulting .htm file in NotePad or similar and
see the source that has been generated - including all the styles. Then use
that as the template for your generated file.

Now the secret's out.....

--
Mike Brind
MVP - ASP/ASP.NET
Oct 1 '08 #2
Kevin wrote on Wed, 1 Oct 2008 07:52:09 -0700 (PDT):
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 Excel using 'Response.ContentType =
"application/vnd.ms-excel"'? If so, would you be willing to share your
secret?
Thanks in advance!
Kevin G.

Your MIME type is only causing IE to load the HTML you're sending into
Excel - you're not actually sending an Excel file (so technically your MIME
type is wrong). This is not an ASP issue, this is an Excel HTML conversion
issue and you'd be better off asking on an Excel group or searching the web
for articles on formatting HTML correctly for Excel to handle it the way
you'd expect it to be handled.

--
Dan
Oct 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
0
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...
8
by: Cardman | last post by:
I am hopeful that someone can quickly solve my image alignment issue when things are just not going right and where my attempts to solve this alignment issue have all failed. First of all take a...
1
by: jessi | last post by:
Hello!!! I need to insert an image file in this XML Excel file. How can I do it? <?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook...
2
by: Ch Pravin | last post by:
Hi All: I am having the following xml which i need to convert to excel using xslt. Please help me out. Afghanistan.xml <?xml version="1.0" encoding="utf-16"?> <Languages...
7
by: bobh | last post by:
Hi, I have this code in the groupheader_print section of an AccessXP report. What is the code to 'Bold' the text288 cell. thanks bobh. 'this is the rpting category header wks.Cells(row, 1) =...
16
by: Phil Stanton | last post by:
I have a form with a button which is supposed to open an Excel file (With lots of Macros /VBA) in it. The Excel file gets it's data from the Access program Here is the code Private Sub...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
9
by: AGP | last post by:
I have a VB6 application that has an OLE container with an embedded Excel chart. Our office updated to Excel 2007 and now although the app works the charts looks like crap. Since the app is fairly...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...

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.