Display a Datagrid & Export a Datagrid to Excel

P

Paul D. Fox

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
 
E

Elton Wang

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top