By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,780 Members | 1,549 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,780 IT Pros & Developers. It's quick & easy.

ASP to Excel Image Alignment Problems

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a

"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

P: n/a
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.