Forum How do I...?

ASP.net: has anyone tried running Prince.exe via b/g process

psmealey
I am having difficulty with a particular client report, and am looking for some options. The problem is as follows:

When I execute the Prince.Exe right from the code-behind, it works reliably. However the report is so complex that it can take 10-15 minutes to process, where it seems reasonable to throw up a modal please stand by dialogue. When I have tried to do that in multiple ways, it causes the prince process to time out (even though the pdf is still generated on the server).

In an effort to resolve this, I am looking into putting the prince routines inside of a BackgroundManager, web service type process. Is this possible given the nature of the exe itself? or are there other ways at this issue? For example has anyone implemented a progress meter type solution with Prince?

many thanks!
mikeday
I'm not familiar with many of the ASP terms in this query, unfortunately. Are you returning the PDF to the browser immediately, as the result of a HTTP POST? Or do you want to save it on the server and allow the user to download it later? How big is this report? 10-15 minutes sounds like a very long time for one document!
psmealey
Apologies for my over-reliance on ASP jargon. Essentially, I'm asking if it's possible to put the prince process in a background thread, while the user moves on (and eventually receives a notification with a link to where s/he can download the doc from the server).

I have tried various methods (response.write, response.addheader, respond.transmitfile, response.outputstream), and while they all work as linear processes, it's been difficult to build a smooth user experience around it (the app needs to be reasonably idiot-proof).

It's essentially a dashboard report with a dense table, and seven (Nevron Chart) pie and bar graphs. It prints out to be about 250kb, so not huge, but complex enough to slow down the prince.exe.

I have experimented with reduced graphics, but this doesn't really seem to help (and kind of defeats the purpose, because this will be a client-facing document, so it needs to look as slick as possible).

Thanks for the quick reply.
mikeday
Roughly how many pages is the report? Does it require downloading many images or other resources over the network? Just it should be possible to generate documents that a hundreds of pages long in under a minute, in normal circumstances. So I would definitely see if the conversion can be sped up at all.

For asynchronous document conversion, you would need to do something like this: browser issues a GET or POST that triggers the server to begin the conversion in a background process, generate a unique ID and redirect the browser to a URL with that ID. When it receives a GET to that URL, it checks to see if the conversion is done yet, and returns a HTML page saying "Please wait..." with an automatic refresh in ten seconds if it isn't, otherwise it directly returns the generated PDF. There may be an easier way of implementing that in ASP, though! :)