Mike: Here a trick I developed that might help you. I needed to create a pie chart showing the results of an on-line poll. I used Macromedia Pollster to create and maintain the polls. Pollster uses a Flash user interface, but my client want an HTML equivalent. So I used an HTML form to collect the data and cfchart to display it. I ran into the same problem with the chart image expiring. Also, the site is heavily cached. The solution that I came up with is a little clunky but it works.
Use cfsavecontent to capture the output of the cfgraph call. Parse the cfsavecontent output and recover the image file name that was created with cfgraph. It looks something like '/CFIDE/GraphData.cfm?graphCache=wc50&graphID=Images&id="Images_123456789"'. Once I have the image file name and location, I made a copy of the image in my cache directory with cffile. Pollster uses UUIDs to id the polls, so I named them image "cache/UUID.png". I go through the above logic whenever someone takes the poll, thereby refreshing the image. Lastly, to force the browser to refresh the image I append the vote count as a URL parameter in the image statement: <img src="cache/UUID.png?total=#totalVotes#"/> This seems to solve the problem of the expiring image and allows me keep the site cached. You can see the browser side of the code in action at http://www.frbatlanta.org/. I generated a png but it will work with jpg (or gif). Sincerely, Brooks Wilson 640K ought to be enough for anybody. - Bill Gates (1981) Federal Reserve Bank of Atlanta · 1000 Peachtree Street, N.E. · Atlanta Georgia 30309-4470 404.498.8178 · fax 404.498.8239 · [EMAIL PROTECTED] "Ajas Mohammed" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 04/22/2008 10:52 AM Please respond to [email protected] To [email protected] cc Subject Re: [ACFUG Discuss] CFChart and printing Hi, Try this I guess you need to increase the timeout value. The charts/images are cached and the timeout value says how long to cache the chart/images. go to cf install path\lib\webcharts.3d.xml look for the code below at the top <?xml version="1.0" encoding="UTF-8"?> <server image="PNG" cache="Memory" minTimeout="5000" maxTimeout="30000" so on................. time is in millisecs we had same issue and setting timeout value fixed the issue. Hope it helps. Try it out. -- <Ajas Mohammed /> http://ajashadi.blogspot.com No matter what, find a way. Because thats what winners do. You can't improve what you don't measure. Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives. "Live as if you were to die tomorrow. Learn as if you were to live forever." On 4/21/08, Mike Staver <[EMAIL PROTECTED]> wrote: An application I'm working on uses the CFChart tag to generate a bar graph based on a query. The graph looks great on the screen. This graph is inside a loop, and the graph gets generated approximately 1 to 6 times in most cases. When the user tries to print the screen, some of the images print and some don't. When the system really starts acting up, not a single image will print. The message being displayed in the images place on the print out is "Image Expired", etc. The standard message when you hit a back button to view a page without refreshing the page. Some other info to note: 1) This webserver is NOT clustered. 2) ColdFusion version MX 7.0.2. 3) The cfchart tag is generating a jpeg image. 4) The browser in question is IE 7. 5) The webserver is IIS 6 on Windows 2003, using SSL. 6) The user is immediately trying to print the page, not letting it sit for more than 10 seconds max. 7) The site is not under any kind of heavy load. 8) I don't immediately have access to IIS or ColdFusion logs. All the research I've done points to the problem of having a clustered site, which does not fit my case here. Has anybody else had to deal with this issue before? ------------------------------------------------------------- Annual Sponsor FigLeaf Software - http://www.figleaf.com To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by http://www.fusionlink.com ------------------------------------ ------------------------------------------------------------- Annual Sponsor - Figleaf Software To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink -------------------------------------------------------------
<<image/gif>>
<<image/gif>>
<<image/gif>>
