Focal Point
[CLOSED] output to excel from in ASP.net after calling WF via service

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2577081495

November 23, 2010, 11:46 AM
Kowens
[CLOSED] output to excel from in ASP.net after calling WF via service
Hi,

I have an ASP.NET application that is calling 3 webfocus reports via a webservice one after the other. They have the option to get the output in excel, so after the return of the service, I check for the mime = application/vnd.ms-excel.

My issue is because there are 3 reports, excel doesn't seem to be opening fast enough, and the reports render back faster than excel can open, so I am losing report output. Has anyone had this issue before? If so, how did you fix it?


Code is as follows. I even tried putting it to sleep at the end of this, before the next report was rendered to give excel a chance to catch up.


If (ret.mime = "application/vnd.ms-excel") Then
Response.ClearHeaders()
Response.Buffer = True
Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
'Response.AddHeader("Content-Disposition", "inline;filename=output.xlsx")
Dim headerAttributes As String = "attachment;filename=" & report.name & ".xlsx"

Response.AddHeader("Content-Disposition", headerAttributes)

Response.BufferOutput = True

Response.Write(ret.output)

Response.End()
Response.Flush()

This message has been edited. Last edited by: Kerry,


Version: 8.0.0.6
Windows platform
All output formats will probably be used.
December 10, 2010, 10:57 AM
dlogan
Kowens,
This is really much more of an ASP.net question than it is a WebFOCUS question.

They way you would handle this in ASP.net should be the same way you'd handle retrieving and displaying multiple Excel documents from any source via ASP.net.

Have you thought of posting on:
forums.asp.net

I personally would almost wonder if the issue is that the web browser thinks its the same document coming back three times.

Have you tried targeting three separate i-frames with the outputs of these three Excel documents to see if it changes anything? The download HTTP Header's you have, *should* cause the file to download anyway even though its opening in an i-frame.

If this works proof-of-concept, there might be something more creative along these lines you could use.


WF 71.x, 76.x, 7701, 8.0 Beta OS: Linux, Win2k3, Win2k, Win2k8, WinXP