Export Page to Excel. Missing CSS problem

Discussion in 'ASP .Net' started by Server Control, Mar 14, 2006.

  1. Hi,
    I want to export an entire Page to excel. If I try to export the page
    with Inline disposition:
    Response.AddHeader("content-disposition", "inline;filename=abc.xls");
    the css and formatting appears properly.
    However, if I use "Attachment" type
    Response.AddHeader("content-disposition",
    "attachment;filename=abc.xls"); I get an error dialog : saying "Missing
    File: C:\....\Style.css". It is unable to find the css files on my
    page.
    I need to open the excel in a new window. If anyone knows about this
    problem, please let me know.
    Server Control, Mar 14, 2006
    #1
    1. Advertising

  2. Server Control

    Bruce Barker Guest

    if you want the user to download and use an html page, you need to change
    all image and style references to fully qualified
    (http://mysite/styles/mystyle.css) rather then relative.

    -- bruce (sqlwork.com)


    "Server Control" <> wrote in message
    news:...
    > Hi,
    > I want to export an entire Page to excel. If I try to export the page
    > with Inline disposition:
    > Response.AddHeader("content-disposition", "inline;filename=abc.xls");
    > the css and formatting appears properly.
    > However, if I use "Attachment" type
    > Response.AddHeader("content-disposition",
    > "attachment;filename=abc.xls"); I get an error dialog : saying "Missing
    > File: C:\....\Style.css". It is unable to find the css files on my
    > page.
    > I need to open the excel in a new window. If anyone knows about this
    > problem, please let me know.
    >
    Bruce Barker, Mar 14, 2006
    #2
    1. Advertising

  3. Server Control

    ak1234

    Joined:
    Feb 28, 2008
    Messages:
    1
    Solution for exporting css content to excel

    i think excel file is not recognizing css format. So create a new jsp file and name it as Style.jsp and include all css content in this file under <style>

    Your jsp file should look like this


    <Style type="text/css">

    <!--CSS content in .css file-->

    </style>

    Include Style.jsp in all the jsp files whereever you want to open the excel page using <jsp:include page="Style.jsp">

    Remove the tag which imports .css file<link href=".css">

    This should work.
    ak1234, Feb 28, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3JpZGhhcg==?=

    using Microsoft Excel image for Export to Excel button

    =?Utf-8?B?U3JpZGhhcg==?=, Dec 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    3,076
    =?Utf-8?B?U3JpZGhhcg==?=
    Dec 9, 2005
  2. Replies:
    3
    Views:
    11,370
    Patrick.O.Ige
    May 24, 2006
  3. =?Utf-8?B?SGVtYW50IFNpcGFoaW1hbGFuaQ==?=

    Export to Excel (Default File Type - Excel)

    =?Utf-8?B?SGVtYW50IFNpcGFoaW1hbGFuaQ==?=, Apr 24, 2006, in forum: ASP .Net
    Replies:
    15
    Views:
    17,461
    syed hassan
    May 21, 2009
  4. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,481
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  5. Grey
    Replies:
    4
    Views:
    1,936
    Mark Rae [MVP]
    Oct 17, 2007
Loading...

Share This Page