|
|
|
Junior Member
      
Group: Forum Members
Last Login: 5/15/2008 10:23:51 PM
Posts: 11,
Visits: 29
|
|
Is there a way to track the saveAsImage completion? I have several charts on a page, I have embedded these in an iframe and then I want to track when the saveAsImage completes. And when that happens I would like to retrieve the images from the cache and generate a PDF. Currently I am saving the images to Cache successfully, but would like to know when to invoke the PDF generation routine, without waiting for some arbitrary time. I cannot embed this logic inside imageSaveURL target since I am dealing with multiple charts. It would be really nice if in the next version we can have an elegant way of handling multiple charts without resorting to iframes.
Thanks!
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: 5/15/2008 10:23:51 PM
Posts: 11,
Visits: 29
|
|
I have come up with a possible workaround. Use the iframe onload method to call another javascript function that will call a PDF generation routine. The process is as follows:
1. render multiple iframes with charts
2. add a button that when clicked calls the saveAsImage function on all iframes
3a. the saveAsImage passes the control to a http handler that creates the image and adds it to the cache
3b. the last step of the handler writes out a javascript history.go(-1)
4. step 3a/3b above is repeated for all iframes on the page
5. add an onload method on the last iframe which will react to the onload event when the history.go(-1) is called
6. this onload method will pass the control to a render PDF javascript function that will invoke a separate http handler that will read the images from cache and generate a pdf
if someone has a better method, please let me know.
|
|
|
|