473,396 Members | 1,907 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,396 software developers and data experts.

Please wait...

Hello,

I am generating a pdf file via some code. It takes
approx. 30 secs to create the pdf and to show it to the
user. During that time, I want to show a message
like "Please Wait...". Ideally I would like to show only
this message in some kind of messagebox and show the pdf
page only when the processing has been finished. However I
dont know how to do that. What I tried was the following:

I hardcoded the string "Please wait..." In the same page,
where I create the pdf. However when the pdf is going to
run, then I get the message:

System.Web.HttpException: Server cannot set content type
after HTTP headers have been sent.

I was using this code:

Dim context As System.Web.HttpContext =
System.Web.HttpContext.Current
Dim response As System.Web.HttpResponse = context.Response
response.Clear()
response.ContentType = "application/pdf"
pdfDocument.Generate(response.OutputStream)
response.End()

Can anybody please guide me on what to do here?

Thanks
Nov 19 '05 #1
4 2032
For a please wait, try:
http://blogs.crsw.com/mark/articles/642.aspx

You should try to add Response.ClearHeaders() for your specific problem...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Anonymous" <an*******@discussions.microsoft.com> wrote in message
news:14****************************@phx.gbl...
Hello,

I am generating a pdf file via some code. It takes
approx. 30 secs to create the pdf and to show it to the
user. During that time, I want to show a message
like "Please Wait...". Ideally I would like to show only
this message in some kind of messagebox and show the pdf
page only when the processing has been finished. However I
dont know how to do that. What I tried was the following:

I hardcoded the string "Please wait..." In the same page,
where I create the pdf. However when the pdf is going to
run, then I get the message:

System.Web.HttpException: Server cannot set content type
after HTTP headers have been sent.

I was using this code:

Dim context As System.Web.HttpContext =
System.Web.HttpContext.Current
Dim response As System.Web.HttpResponse = context.Response
response.Clear()
response.ContentType = "application/pdf"
pdfDocument.Generate(response.OutputStream)
response.End()

Can anybody please guide me on what to do here?

Thanks

Nov 19 '05 #2
This is simplest solution I've seen:
http://www.aspnetpro.com/NewsletterA...200308bm_l.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://SteveOrr.net
"Anonymous" <an*******@discussions.microsoft.com> wrote in message
news:14****************************@phx.gbl...
Hello,

I am generating a pdf file via some code. It takes
approx. 30 secs to create the pdf and to show it to the
user. During that time, I want to show a message
like "Please Wait...". Ideally I would like to show only
this message in some kind of messagebox and show the pdf
page only when the processing has been finished. However I
dont know how to do that. What I tried was the following:

I hardcoded the string "Please wait..." In the same page,
where I create the pdf. However when the pdf is going to
run, then I get the message:

System.Web.HttpException: Server cannot set content type
after HTTP headers have been sent.

I was using this code:

Dim context As System.Web.HttpContext =
System.Web.HttpContext.Current
Dim response As System.Web.HttpResponse = context.Response
response.Clear()
response.ContentType = "application/pdf"
pdfDocument.Generate(response.OutputStream)
response.End()

Can anybody please guide me on what to do here?

Thanks

Nov 19 '05 #3
I already tried to clear the headers, but it says:

Cant clear header after it has been set.
-----Original Message-----
For a please wait, try:
http://blogs.crsw.com/mark/articles/642.aspx

You should try to add Response.ClearHeaders() for your specific problem...
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more tocome!)
"Anonymous" <an*******@discussions.microsoft.com> wrote in messagenews:14****************************@phx.gbl...
Hello,

I am generating a pdf file via some code. It takes
approx. 30 secs to create the pdf and to show it to the
user. During that time, I want to show a message
like "Please Wait...". Ideally I would like to show only
this message in some kind of messagebox and show the pdf
page only when the processing has been finished. However I dont know how to do that. What I tried was the following:
I hardcoded the string "Please wait..." In the same page, where I create the pdf. However when the pdf is going to
run, then I get the message:

System.Web.HttpException: Server cannot set content type
after HTTP headers have been sent.

I was using this code:

Dim context As System.Web.HttpContext =
System.Web.HttpContext.Current
Dim response As System.Web.HttpResponse = context.Response response.Clear()
response.ContentType = "application/pdf"
pdfDocument.Generate(response.OutputStream)
response.End()

Can anybody please guide me on what to do here?

Thanks

.

Nov 19 '05 #4
Hello Anonymous,

You can not intermix a PDF and HTML in the same window... This is where your
problem is coming from. You're sending content to the browser and then sending
the PDF which has a different content type header (application/pdf).

--
Matt Berther
http://www.mattberther.com
I already tried to clear the headers, but it says:

Cant clear header after it has been set.
-----Original Message-----
For a please wait, try:
http://blogs.crsw.com/mark/articles/642.aspx
You should try to add Response.ClearHeaders() for your

specific problem...
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the

popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup

FAQ (more to
come!)

"Anonymous" <an*******@discussions.microsoft.com> wrote

in message
news:14****************************@phx.gbl...
Hello,

I am generating a pdf file via some code. It takes
approx. 30 secs to create the pdf and to show it to the
user. During that time, I want to show a message
like "Please Wait...". Ideally I would like to show only
this message in some kind of messagebox and show the pdf
page only when the processing has been finished. However I
dont know how to do that. What I tried was the
following:
I hardcoded the string "Please wait..." In the same
page,
where I create the pdf. However when the pdf is going to run, then I
get the message:

System.Web.HttpException: Server cannot set content type after HTTP
headers have been sent.

I was using this code:

Dim context As System.Web.HttpContext =
System.Web.HttpContext.Current
Dim response As System.Web.HttpResponse = context.Response
response.Clear()
response.ContentType = "application/pdf"
pdfDocument.Generate(response.OutputStream)
response.End()
Can anybody please guide me on what to do here?

Thanks

.

Nov 19 '05 #5

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

Similar topics

4
by: Jason . | last post by:
I have seen a few articles with a javascript example but it is not working for me. The server side code is processed first and then the javascript so I basically get my page loading splash screen...
3
by: Danny Masti | last post by:
Hello, I have a HIDDEN div with a "Please Wait Message". OnSubmit I show the hidden div with the "Please Wait Message". It works fine. But if I replace the "Please Wait Message" with an animated...
0
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from...
4
by: dave | last post by:
Hi guys I display one page in popup window...that fetches some data from sql and perfom some calculation (tht approx 10 secs) and display result.... I am trying to display "Please wait ..."message...
3
by: John Dalberg | last post by:
Hi I have a form that opens a new window for the results. Because the results might take a few seconds due to server processing, I would like to display a message "please wait" in the new...
5
by: Chris | last post by:
Hi, I was following the article http://msdn.microsoft.com/msdnmag/issues/03/12/DesignPatterns/default.aspx I got everything working until I go the the Progress bar section. Here is where I am...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
4
by: puja patel | last post by:
hi all, I am developing a shopping cart website in C# where after selecting item, user enters credit card details and click on submit button.This request is then processed by the gateway which...
1
by: =?Utf-8?B?Sm9obiBXYWxrZXI=?= | last post by:
Hi, I have a webpage designed with asp.net 2.0. Is there a way to display a "please wait" message to the screen horizontally centered and veritcally 20px from the VISIBLE top of the page,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.