views:

273

answers:

3

I am building a Flex Application that calls a .aspx page on the same webserver which builds a PDF report using SQL Reporting Services. When the report is built it prompts the user to open or save the PDF.

We are trying to find a way to display a Progress Bar to let the user know that the report they requested is being built, and then destroy the Progress Bar once the report is finished being built.

I've tried opening a new window using JavaScript and trying to catch when the window closes, as well as trying XMLHTTPRequest, but nothing to seems to work.

Does anyone have any suggestions?

+1  A: 

There are 2 options:

  1. Use the FileReference class in Flex to programmatically invoke your aspx file. You will be able to track the progress of the call from within Flex by listening to its events. But the users can only save the PDF, not open it.
  2. Have an intermediate HTML page that displays a loading icon and then refresh itself to your PDF generating ASPX page. Encode your aspx url along with parameters etc and set it as a parameter to this intermediate page so it knows what to load.
Chetan Sastry
A: 

If you don't have control over the page to be able to put JavaScript on it to hit a URL (or call back to the parent/opener), then you might consider whipping up an aspx page of your own to host a ReportViewer control, and display the report inside of that. This would require you to create a .NET website with a page and a web.config - you wouldn't need to do more than make it receive any parameters your report needs, and it would be do-able via inline-to-the-aspx code as opposed to requiring in-depth .NET knowledge.

Or, you could hit the SS-RS API and render the report directly. Here, you'd craft a URL with parameters for the report on the SS-RS API site to accept. I think, though I don't know for sure, that the SS-RS UI uses the API itself behind the scenes. By default the API is hosted in a site called "reportserver" - you might sniff HTTP traffic while the report is being rendered to get you started with the URL that you'd need to hit.

Peter Mounce
A: 

Another option not mentioned here is to create a .Net webservice, add it to your flex project and when it hits the result handler you know the file is created at that point.

Chris Klepeis