ASP to Excel Image Alignment Problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin G.

    ASP to Excel Image Alignment Problems

    Hello,

    I'm exporting an ASP page to Excel using 'Response.Conte ntType =
    "applicatio n/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.Conte ntType = "applicatio n/vnd.ms-excel"'? If so, would
    you
    be willing to share your secret?

    Thanks in advance!

    Kevin G.
  • Mike Brind [MVP]

    #2
    Re: ASP to Excel Image Alignment Problems


    "Kevin G." <KevinGravelle@ gmail.comwrote in message
    news:421086f3-c586-467b-8738-5741292d057f@64 g2000hsm.google groups.com...
    Hello,
    >
    I'm exporting an ASP page to Excel using 'Response.Conte ntType =
    "applicatio n/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.Conte ntType = "applicatio n/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


    Comment

    • Daniel Crichton

      #3
      Re: ASP to Excel Image Alignment Problems

      Kevin wrote on Wed, 1 Oct 2008 07:52:09 -0700 (PDT):
      Hello,
      I'm exporting an ASP page to Excel using 'Response.Conte ntType =
      "applicatio n/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.Conte ntType =
      "applicatio n/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


      Comment

      Working...