I have an query output with 200+ records in it which i am displaying 100 at a time. and i am using cfFlush to display a wait message while it s loading. (which i cant figure out how to get rid of after its loaded)

my question is (and i'm assuming there isnt) but is there a way to know the progress of the query to display a progress bar... or is there a way to cfflush the output so that it will begin populating while its still querying? it is taking about a minute for the page to display and i am trying to stop users from reloading the page in mid query.

[B]Failed to add HTML header.[/B]  
ColdFusion was unable to add the header you specified to the output stream. This is probably because you have already used a cfflush tag in your template or buffered output is turned off.  
  
The error occurred in C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\DMS\report\estimate_excel.cfm: line 1264
 
1262 : 
1263 : 
1264 : <cfheader name="Content-Disposition" value="inline; filename=ise_#HUserID#.xls"> 
1265 : <cfcontent type="application/vnd.ms-excel" file="#pathToOutFile#">
1266 :

You could use cfajaxproxy and use javascript to show/hide a waiting gif image. Look up that tag at Adobe, it is a great tag. With cfflush you can only use it once I believe because the headers for the web page has already been sent over to the browser.

is there a way to know the progress of the query to display a progress bar...

No. Queries don't return partial progress. You'll only know when they're complete.

or is there a way to cfflush the output so that it will begin populating while its still querying?

Definitely not for file downloads. The old hack was to display a fake progress image/div when the download starts. Then hide it when the download's finished. The newer tags like cfprogressbar are a spin on that old idea. http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec19562-7fdf.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.