Display a Datagrid & Export a Datagrid to Excel

Discussion in 'ASP .Net Datagrid Control' started by Paul D. Fox, Jul 21, 2005.

  1. Paul D. Fox

    Paul D. Fox Guest

    I have a page displaying a datagrid and the user wants to have two options:
    1. Export the current "Displayed" datagrid to Excel
    2. Export another Datagrid very similar to the first, but with many
    additional columns

    I'd like to run just one stored procedure and populate both datagrids on the
    page, however in order to get the second datagrid to Export to Excel, I have
    to make it "Visible" (the user doesn't need to see it). My work-around is
    to re-run the stored proc on the LinkButton event of the export to Excel and
    then export it. Is there a way I can do this without running the stored
    proc twice?

    Paul
     
    Paul D. Fox, Jul 21, 2005
    #1
    1. Advertising

  2. Paul D. Fox

    Elton Wang Guest

    If you don't want to re-query DB, in first time, save data source (dataset,
    datatable, or dataview) in Session. Then when needed, retrieve it from
    Session.

    HTH

    Elton Wang

    "Paul D. Fox" <> wrote in message
    news:...
    > I have a page displaying a datagrid and the user wants to have two

    options:
    > 1. Export the current "Displayed" datagrid to Excel
    > 2. Export another Datagrid very similar to the first, but with many
    > additional columns
    >
    > I'd like to run just one stored procedure and populate both datagrids on

    the
    > page, however in order to get the second datagrid to Export to Excel, I

    have
    > to make it "Visible" (the user doesn't need to see it). My work-around is
    > to re-run the stored proc on the LinkButton event of the export to Excel

    and
    > then export it. Is there a way I can do this without running the stored
    > proc twice?
    >
    > Paul
    >
    >
     
    Elton Wang, Jul 21, 2005
    #2
    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?RGF2aWQgVmFsbGU=?=

    Invalid export DLL or export format

    =?Utf-8?B?RGF2aWQgVmFsbGU=?=, Oct 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    3,640
    =?Utf-8?B?RGF2aWQgVmFsbGU=?=
    Oct 29, 2003
  2. =?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,134
    =?Utf-8?B?U3JpZGhhcg==?=
    Dec 9, 2005
  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,579
    syed hassan
    May 21, 2009
  4. Grey
    Replies:
    4
    Views:
    2,041
    Mark Rae [MVP]
    Oct 17, 2007
  5. sed_y
    Replies:
    0
    Views:
    1,037
    sed_y
    Feb 15, 2012
Loading...

Share This Page