Excel properties

Discussion in 'ASP General' started by middletree, Mar 28, 2005.

  1. middletree

    middletree Guest

    Curt and McKirahan have been very helpful the past week as I have been
    introduced to something new to me: generating a spreadsheet from ASP.

    Now that I have the spreadsheet, I am in need of knowledge about how to
    control the properties. By properties, I mean font, hyperlink, and color
    information. I'd like the spreadsheet to have the same data as the HTML page
    it's getting the data from, but in a different format. I have been searching
    in
    several places, including the Excel Help files, but cannot find any info on
    how to do this.

    I'm not asking anyone to tell me how to do this; just looking for where to
    find out how to do this.

    Anyone here have any idea where I can look?
     
    middletree, Mar 28, 2005
    #1
    1. Advertising

  2. "middletree" <> wrote in message
    news:#xop4W#...
    > Curt and McKirahan have been very helpful the past week as I have been
    > introduced to something new to me: generating a spreadsheet from ASP.
    >
    > Now that I have the spreadsheet, I am in need of knowledge about how to
    > control the properties. By properties, I mean font, hyperlink, and color
    > information. I'd like the spreadsheet to have the same data as the HTML

    page
    > it's getting the data from, but in a different format. I have been

    searching
    > in
    > several places, including the Excel Help files, but cannot find any info

    on
    > how to do this.
    >
    > I'm not asking anyone to tell me how to do this; just looking for where to
    > find out how to do this.
    >
    > Anyone here have any idea where I can look?



    In addition to what Curt said, try creating the spreadsheet first in Excel
    and then save it as HTML. Look at the resulting code so you can "reverse
    engineer" the proper output format you need.

    --
    Tom Kaminski IIS MVP
    http://www.microsoft.com/windowsserver2003/community/centers/iis/
    http://mvp.support.microsoft.com/
    http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
     
    Tom Kaminski [MVP], Mar 29, 2005
    #2
    1. Advertising

  3. middletree

    Guest

    > > Anyone here have any idea where I can look?
    >
    >
    > In addition to what Curt said, try creating the spreadsheet first in

    Excel
    > and then save it as HTML. Look at the resulting code so you can

    "reverse
    > engineer" the proper output format you need.


    No need to reverse engineering most of it since MS puts out
    documentation on how to use this:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoffxml/html/ofxml2k.asp

    We use Excel basically for our print engine in ASP reports. I have a
    default style sheet that sets up page margins, "fit to" properties, and
    "repeat at top" setting which I pass in via a session variable to
    repeat a certain # of rows at each page. Works great. There's just a
    couple of annoyances in Excel, such as when you put a formula in a
    cell, it doesn't automatically change the width of the cell to fit the
    RESULT of the formula, so you have to specifically set the width in
    pixels.
     
    , Mar 29, 2005
    #3
  4. middletree

    middletree Guest

    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:%...
    > Now I dont know this for sure, but since the HTML code for generating an

    XLS
    > is really just an html table/cell thing you should be able to use these

    same
    > tags to set some attributes. Beyond that you may have to go to using a
    > component for your doc. There are limited capabilities in
    > HTML/ASP/VbScript/etc....



    Well, the problem is, there are things in the presentation on the HTML page
    (from which the spreadsheet is launched) that I don't want in the
    spreadsheet, such as hyperlinks, the gridlines not showing, etc, as well as
    some things to be changed, such as background colors, fonts, etc.

    So I'm assuming there is some sort of a DOM for this, but I can't find any
    doc on it.
     
    middletree, Mar 29, 2005
    #4
  5. middletree

    middletree Guest

    "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    news:...
    > In addition to what Curt said, try creating the spreadsheet first in Excel
    > and then save it as HTML. Look at the resulting code so you can "reverse
    > engineer" the proper output format you need.



    I don't think I'm doing a good job of explaining myself. I have a web page,
    and is displays data. I want to export that data into a spreadsheet, with
    the click of a button. I have this working successfully. However, the
    resulting spreadsheet carries the properties that the HTML version has,
    properties that I don't want it to carry over. The gridlines don't show, the
    rows are alternating colors, I'd like to change the fonts, and I'd like to
    remove the hyperlinks.

    I figure this thing must have a DOM or some way to specify properties as it
    generates the spreadsheet, but I am looking for instructions on how to do
    this.
     
    middletree, Mar 29, 2005
    #5
  6. middletree

    middletree Guest

    Hmmm, if I write up a style sheet, separate for the ASP page which produces
    the spreadsheet, I wonder if that might work.
     
    middletree, Mar 29, 2005
    #6
  7. middletree

    Guest

    middletree wrote:
    > "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    > news:...
    > > In addition to what Curt said, try creating the spreadsheet first

    in Excel
    > > and then save it as HTML. Look at the resulting code so you can

    "reverse
    > > engineer" the proper output format you need.

    >
    >
    > I don't think I'm doing a good job of explaining myself. I have a web

    page,
    > and is displays data. I want to export that data into a spreadsheet,

    with
    > the click of a button. I have this working successfully. However, the
    > resulting spreadsheet carries the properties that the HTML version

    has,
    > properties that I don't want it to carry over. The gridlines don't

    show, the
    > rows are alternating colors, I'd like to change the fonts, and I'd

    like to
    > remove the hyperlinks.
    >
    > I figure this thing must have a DOM or some way to specify properties

    as it
    > generates the spreadsheet, but I am looking for instructions on how

    to do
    > this.


    Have two style sheets, one where it's an HTML view, the other for
    Excel.
     
    , Mar 29, 2005
    #7
  8. middletree

    middletree Guest

    I've used this method to change the appearance of a web page when printing
    before, and in fact, use it on this same Intranet app. I didn't know you
    could specify it for Excel files that you build through ASP. In your
    example, does it use the media=screeen, or media=print to apply to the
    spreadsheet? Remember, I'm trying to affect the way the spreadsheet looks on
    the screen. It may or may not get printed.


    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:...
    > Ahh... that's different.
    > Use something like this to build a different versions for display/use
    > http://www.darkfalz.com/1066
    >
    >
    > --
    > Curt Christianson
    > Site & Scripts: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "middletree" <> wrote in message
    > news:...
    > >
    > > "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    > > news:...
    > >> In addition to what Curt said, try creating the spreadsheet first in
    > >> Excel
    > >> and then save it as HTML. Look at the resulting code so you can

    "reverse
    > >> engineer" the proper output format you need.

    > >
    > >
    > > I don't think I'm doing a good job of explaining myself. I have a web
    > > page,
    > > and is displays data. I want to export that data into a spreadsheet,

    with
    > > the click of a button. I have this working successfully. However, the
    > > resulting spreadsheet carries the properties that the HTML version has,
    > > properties that I don't want it to carry over. The gridlines don't show,
    > > the
    > > rows are alternating colors, I'd like to change the fonts, and I'd like

    to
    > > remove the hyperlinks.
    > >
    > > I figure this thing must have a DOM or some way to specify properties as
    > > it
    > > generates the spreadsheet, but I am looking for instructions on how to

    do
    > > this.
    > >
    > >

    >
    >
     
    middletree, Mar 30, 2005
    #8
  9. middletree

    middletree Guest

    <> wrote in message
    news:...
    >
    > Have two style sheets, one where it's an HTML view, the other for
    > Excel.


    So you specify one on the new ASP page (not the one which contains the
    button to geerate the .xls file)?
     
    middletree, Mar 30, 2005
    #9
  10. middletree

    middletree Guest

    Ok. I don't have my code handy right now, but as I recall I had:

    Page 1, which consists of a table built by ASP using an SQL query. It looks
    like this:
    http://www.middletree.net/sort.htm

    Keep in mind that that's an HTML page that I put out on my personal site,
    not the real deal. But I got it by saving the real one to an HTML file, so
    it's an example of the possible output for page 1.

    Now, Page 1 has a submit button at the bottom (not shown in the example
    page), which calls you to what we'll refer to as Page 2. That page has no
    HTML, just some ASP. To see that code, see the answer given to me in the
    thread which I began March 25 at 11:42 AM Central time. I used that code as
    a basis for what I did.

    So Page 1 has ASP which builds an HTML table. Page 2 just has some ASP code
    which tells it to take everything in that table and build a spreadsheet.
    Since Page 2 has no HTML, I don't see room for code which references a
    stylesheet.

    I'm not trying to be argumentative, just trying to understand how this could
    be done. If you tell me that I should just put the style sheet with the
    proper formatting in that second page, then I'll try it out first thing
    tomorrow morning.

    Even then, though, I don't know how I'd code to include the gridlines (which
    currently aren't showing in the resulting spreadsheet). I tried simply
    having the table to have a border of 1 instead of 0, but that didn't do the
    trick. I am still trying to find some documentation which describes the
    syntax for this stuff.

    I appreciate your bearing with me.


    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:#...
    > What I was getting at is maybe generate it two ways, one visually for the
    > web and one for "saving" where you strip out all the extra tags when a
    > button is clicked?
    >
    > --
    > Curt Christianson
    > Site & Scripts: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "middletree" <> wrote in message
    > news:...
    > > I've used this method to change the appearance of a web page when

    printing
    > > before, and in fact, use it on this same Intranet app. I didn't know you
    > > could specify it for Excel files that you build through ASP. In your
    > > example, does it use the media=screeen, or media=print to apply to the
    > > spreadsheet? Remember, I'm trying to affect the way the spreadsheet

    looks
    > > on
    > > the screen. It may or may not get printed.
    > >
    > >
    > > "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    > > news:...
    > >> Ahh... that's different.
    > >> Use something like this to build a different versions for display/use
    > >> http://www.darkfalz.com/1066
    > >>
    > >>
    > >> --
    > >> Curt Christianson
    > >> Site & Scripts: http://www.Darkfalz.com
    > >> Blog: http://blog.Darkfalz.com
    > >>
    > >>
    > >> "middletree" <> wrote in message
    > >> news:...
    > >> >
    > >> > "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    > >> > news:...
    > >> >> In addition to what Curt said, try creating the spreadsheet first in
    > >> >> Excel
    > >> >> and then save it as HTML. Look at the resulting code so you can

    > > "reverse
    > >> >> engineer" the proper output format you need.
    > >> >
    > >> >
    > >> > I don't think I'm doing a good job of explaining myself. I have a web
    > >> > page,
    > >> > and is displays data. I want to export that data into a spreadsheet,

    > > with
    > >> > the click of a button. I have this working successfully. However, the
    > >> > resulting spreadsheet carries the properties that the HTML version

    has,
    > >> > properties that I don't want it to carry over. The gridlines don't
    > >> > show,
    > >> > the
    > >> > rows are alternating colors, I'd like to change the fonts, and I'd

    like
    > > to
    > >> > remove the hyperlinks.
    > >> >
    > >> > I figure this thing must have a DOM or some way to specify properties
    > >> > as
    > >> > it
    > >> > generates the spreadsheet, but I am looking for instructions on how

    to
    > > do
    > >> > this.
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
     
    middletree, Mar 30, 2005
    #10
  11. middletree

    Guest

    middletree wrote:
    > <> wrote in message
    > news:...
    > >
    > > Have two style sheets, one where it's an HTML view, the other for
    > > Excel.

    >
    > So you specify one on the new ASP page (not the one which contains

    the
    > button to geerate the .xls file)?


    The style sheet reference is on the final HTML/XLS page. The reference
    would to the CSS would be dynamic.
     
    , Mar 30, 2005
    #11
    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. Nathan Sokalski
    Replies:
    0
    Views:
    955
    Nathan Sokalski
    Oct 17, 2005
  2. =?Utf-8?B?Q2hyaXN0b3BoZSBQZWlsbGV0?=

    CompositeControls: ViewState properties w/ Mapped properties probl

    =?Utf-8?B?Q2hyaXN0b3BoZSBQZWlsbGV0?=, Jan 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,161
    Steven Cheng[MSFT]
    Jan 19, 2006
  3. Kent Lichty
    Replies:
    0
    Views:
    854
    Kent Lichty
    Apr 16, 2004
  4. Victor Porton
    Replies:
    1
    Views:
    720
    Steven T. Hatton
    Aug 29, 2004
  5. =?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,597
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
Loading...

Share This Page