473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Export to excel !!

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

Sep 18 '06 #1
4 1535
Please anyone can answer this question.


am***********@gmail.com wrote:
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
Sep 19 '06 #2
On 18 Sep 2006 21:52:18 -0700, "am***********@gmail.com"
<am***********@gmail.comwrote:
Please anyone can answer this question.

am***********@gmail.com wrote:
>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
How does page 1 get populated initially?

regards
A.G.
Sep 19 '06 #3
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
Registered User wrote:
On 18 Sep 2006 21:52:18 -0700, "am***********@gmail.com"
<am***********@gmail.comwrote:
Please anyone can answer this question.

am***********@gmail.com wrote:
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

How does page 1 get populated initially?

regards
A.G.
Sep 19 '06 #4
On 19 Sep 2006 01:54:40 -0700, "am***********@gmail.com"
<am***********@gmail.comwrote:
>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.
>lets see
plz reply
Registered User wrote:
>On 18 Sep 2006 21:52:18 -0700, "am***********@gmail.com"
<am***********@gmail.comwrote:
Please anyone can answer this question.

am***********@gmail.com wrote:
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

How does page 1 get populated initially?

regards
A.G.
Sep 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matt | last post by:
I have an ASP page that calls ASP routines that I created that execute a database query and return the results to a recordset. I then iterate through the recordset and display the data in a table....
5
by: Maria L. | last post by:
Hi, I need to export the content of a DataGrid (in Windows application in C#), into an Excel spreadsheet. Anyone knows how to do this? Any code snippets would help! thanks a lot, Maria
2
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType =...
6
by: Elena | last post by:
I'm trying to export data to an Excel worksheet. I can export the data in the cell values perfectly. I need the code to change a header and footer for the worksheet, not for the columns. Is...
13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
5
by: Simon | last post by:
Dear reader, With the export command you can export a query to Excel. By activate this command a form pop's up with the following text:
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
2
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.