473,320 Members | 2,104 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,320 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 3823

"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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.