A
Anonymous
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
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