Add additional header or data into excel after exporting - asp.net application

Discussion in 'ASP .Net' started by stephen, Jan 5, 2010.

  1. stephen

    stephen Guest

    Hi,

    I am exporting data from datagrid into excel. lets says that the grid has 3
    sets of information in columns like (billing address, shipping address and
    order info). If I export it, it creates an excel document but I want to
    write additional header like "Billing Infomation", "Shipping address",
    "Orders" above the columns on the excel generated. Basically I want to add
    additional info into the excel after or before the excel is generated.

    Any suggestions on how this can be done? Can it be done via asp.net
    application or should it be done after the excel is created?
    Any sample or article will be great.

    Thanks,
    Stephen
    stephen, Jan 5, 2010
    #1
    1. Advertising

  2. "stephen" <> wrote in news:#WgICKjjKHA.5568
    @TK2MSFTNGP02.phx.gbl:

    > Any suggestions on how this can be done?


    Yes

    > Can it be done via asp.net
    > application or should it be done after the excel is created?


    Yes.

    You have two options:

    1. Take over the Excel creation process.
    2. Add to the document.

    Now, as far as how, I have no clue how you are creating the Excel
    document. I know from a DataGrid, but is this the MS dataGrid control,
    or a third party? Are you using a standard built in "export" button or
    is the export something you dinked with?

    For simple excel, an HTML table can create the document. You merely need
    to change the MIME type in the response header. If you need full Excel,
    then someone or something is creating the export.

    With more info, I might be able to help more.

    Peace and Grace,

    --
    Gregory A. Beamer (MVP)

    Twitter: @gbworld
    Blog: http://gregorybeamer.spaces.live.com

    *******************************************
    | Think outside the box! |
    *******************************************
    Gregory A. Beamer, Jan 5, 2010
    #2
    1. Advertising

  3. stephen

    Mark Stevens Guest

    There is a library on Codeplex which will allow you to generate Excel
    2007 documents. It has an option to paste data tables into the
    spreadsheet. I have used it to do he sort of this you are attempting
    to do from data tables and single entries rather than grids.

    Library can be found at: http://simpleooxml.codeplex.com/

    Cheers,
    Mark

    On Tue, 5 Jan 2010 12:11:28 -0600, "stephen" <>
    wrote:

    >
    >Hi,
    >
    >I am exporting data from datagrid into excel. lets says that the grid has 3
    >sets of information in columns like (billing address, shipping address and
    >order info). If I export it, it creates an excel document but I want to
    >write additional header like "Billing Infomation", "Shipping address",
    >"Orders" above the columns on the excel generated. Basically I want to add
    >additional info into the excel after or before the excel is generated.
    >
    >Any suggestions on how this can be done? Can it be done via asp.net
    >application or should it be done after the excel is created?
    >Any sample or article will be great.
    >
    >Thanks,
    >Stephen
    >

    --
    |\ _,,,---,,_ A picture used to be worth a
    ZZZzzz /,`.-'`' -. ;-;;, thousand words - then along
    |,4- ) )-,_. ,\ ( `'-' came television!
    '---''(_/--' `-'\_)

    Mark Stevens (mark at thepcsite fullstop co fullstop uk)

    This message is provided "as is".
    Mark Stevens, Jan 6, 2010
    #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. bienwell
    Replies:
    3
    Views:
    2,639
    bienwell
    May 17, 2005
  2. bienwell
    Replies:
    2
    Views:
    2,291
    bienwell
    Dec 6, 2005
  3. Replies:
    2
    Views:
    516
  4. bienwell
    Replies:
    1
    Views:
    570
    Cowboy \(Gregory A. Beamer\)
    Oct 14, 2008
  5. SK

    Add additional row into header?

    SK, Feb 17, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    177
Loading...

Share This Page