469,921 Members | 2,213 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,921 developers. It's quick & easy.

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 3698

"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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Allison Bailey | last post: by
8 posts views Thread by Cardman | last post: by
1 post views Thread by jessi | last post: by
7 posts views Thread by bobh | last post: by
16 posts views Thread by Phil Stanton | last post: by
9 posts views Thread by AGP | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.