Export to excel !!

A

amitmnagarwal

I have a page where i export to excel the content of Page 1

following code is written on page 2 to generate the excel

Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition", "attachment;
filename=dynamic.xls")

Now i on page 2 some db operation happens, so that data on page 1
should refresh which has datagrid.

i am unable to refresh the data on page1

please guide
 
A

amitmnagarwal

first of all thanks for the reply

Page 1 : fetches data from the database and assigns to a session object
which is accessed in page 2 for generating excel.
This data is bound to a datagrid on page 1.


page 2 is used so that in excel there is only data and not the other
controls which are there on page 2.

What i am trying currently is doing server.transfer to the same page1
so that page 1 has fresh data and then redirecting to page2 to generate
the excel.

lets see
plz reply
 
R

Registered User

first of all thanks for the reply

Page 1 : fetches data from the database and assigns to a session object
which is accessed in page 2 for generating excel.
This data is bound to a datagrid on page 1.


page 2 is used so that in excel there is only data and not the other
controls which are there on page 2.

What i am trying currently is doing server.transfer to the same page1
so that page 1 has fresh data and then redirecting to page2 to generate
the excel.
OK lets see if this is what you want to do.

1 - page 1's data source is some db container
2 - page 2 puts the data into an Excel spreadsheet
3 - page 2 lets the user modify the data w/out writing the changes to
the database
4 - when page 1 gets reloaded its datasource should be the Excel doc
and not the original db container.

Does the problem involve moving the data from step 3 to step 4? If so
you might consider adding page 3 to display the temporary data and use
a cross-page post to let page 3 access page 2's data.

regards
A.G.
 

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

Similar Threads

API to excel dont show data 0
Export To Excel 1
Export Grid View to Excel 1
I want to Display Excel As HTML In js 2
export to excel issue 2
export to excel 0
export to excel 1
export to excel 2

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top