hi i was just wondering how would i be able to upload something onto the same page after the percentage has reached 100%. sorry for hassle but i'm new to CF. thanks
<!--- First thing we need to do is layout a form that will contain our 'processing' page --->
<body bgcolor="#514a4d"
topmargin="60"
leftmargin="10">
<form name="process">
<table width="650"
border="0"
cellspacing="0"
cellpadding="0"
align="center"
bgcolor="#FFFFFF"
vspace="0">
<TR>
<TD colspan="2"
align="center">
<div id="Processing"
style="visibility:visible;">
<h2>Report Processing, please wait...</h2>
</div>
</TD>
</TR>
<TR>
<TD align="center">
<input name="Status"
value="Processing Status:"
width="25"
maxlength="25"
style="border:0px; background-color:##FFFFFF;">
</TD>
<TD>
<input
name="Percent"
width="8"
maxlength="8"
style="border:0px; background-color:##FFFFFF "
value="">
</TD>
</TR>
<TR>
<TD colspan="2">
<div
id="Complete"
style="visibility:hidden; position:relative;
">
<center>
Your report is complete!.
</center>
</div>
</TD>
</TR>
</table>
</form>
<cfflush>
<!--- Create a 'CurrentPercent' variable --->
<cfparam name="CurrentPercent"
type="string"
default="">
<!--- Here we would normally do a query, but I am going loop through a list for an example --->
<cfloop from="1"
to="10"
step="1"
index="i">
<cfoutput>
<cfset CurrentPercent = '#i *
10#'>
<script>
document.process.Percent.value =
#CurrentPercent# + '%';
</script>
<cfflush>
</cfoutput>
<!--- Include your processing here, or use a cfinclude like I did --->
<!--- In this case, I will put a 1 second pause here --->
<CFSET StartWait =
Now()>
<CFLOOP condition="DateDiff('s', Variables.StartWait, now()) lt
1">
</CFLOOP>
<!--- Check if we are at 100 percent --->
<cfif CurrentPercent
eq 100>
<script>
document.process.Percent.value = 'Complete';
</script>
</cfif>
</cfloop>
<!--- Make the 'processing page' text disappear --->
<script>
document.getElementById('Processing').style.visibility = 'hidden';
</script>
hi i was just wondering how would i be able to upload something onto the same page after the percentage has reached 100%. sorry for hassle but i'm new to CF. thanks
I know that, but in this case I wanted the whole screen to be absolutely positioned (along with the bottom), and have the processing section just appear as it goes. worked out well!
Instead of using visibility: visable; and hidden; try using display: block; and display: none; This will prevent your page from displaying a large gap of white space in IE 6+.
I know this application does a lot that you most likely will not want to do, but here is the code I am using.
Also, as a side note: I think a lot of people mistakenly think that they can have a percentage bar while a query is processing on the server. That is a mistake, when a query goes out to the DB server (SQL, DB2, whatever) there is no data coming back to ColdFusion telling it '10% done, 15% done', etc. Where you CAN show processing is in-between sets of queries, or while your application is physically doing some work (in my instance, while I am inserting multiple SQL records) So hopefully that can clarify things for you. :) Anyways, you will have to do some heavy modification to get my code to work for you, but here it is in all its looping glory. ;)

You cannot run a daily-load report for greater than 1 month.

The password you entered does not allow you to run a report greater than 7 days long.
Please see Tamara Wilson to obtain the correct password.

The password you entered does not allow you to run a daily load report.
Please see Tamara Wilson to obtain the correct password.
Hey Justice, I'm having a look at your tutorial and it would be perfect for me to use. Only problem is, it's way over my head...so if you could, could I see a working example with code....Cheers:)
For this percentage meter to work, you would have to be doing something repetative. The loop I put there was just for an example. Think of it like this: First, you run a query to return all distinct orders in the system. Then, you have to loop through the query (or order numbers) and get total bill amounts, invoice information, etc, from several different sources. This is the point, while you are getting all that different information, that would would put the javascript percentage # update in. For doing a file upload, there is no native coldfusion method to present a progress bar. If the files are REALLY huge, you could write something client side in java to break the file into bits, then upload each one to the server and re-combine them, but it looks like you are just uploading a .doc file, so I bet its pretty small. I hope I made sense there! If you still have some questions, I can post a working example out on my site with source code to show you exactly what I mean! :) Let me know what you need!
Hey justice, I did the tutorial but I think there is a problem with the loop. I put the following code
Well, the way I use this: I have to perform a query from 1 datasource, then I process that data (some logic, some variables, etc), and I have to insert it into another database (SQL server temp tables) so the user can view individual data sets in a report. I present the user a percentage bar so they know how the report is coming (especially when they have to wait about 5 minutes if they are running a month's worth of data or more) :) If you want more specific examples, just toss me another comment! :)
I like the taught of a processing counter, but how would you incorparate a query instead of a loop?