Hello,

We are running into an issue with a template that used to work and I would 
very much appreciate it if anybody could give us some insight into why it is 
now broken and/or a quick and easy work-around.

The portion of the template which is exibiting behavior different than what 
it used to is a <CFFILE> tag which appends many rows of data to a remote 
..csv file after pulling this information from a SQL Server table. The SQL 
Server instance is located on the same server as is the .csv file that we 
are writing to.

When executed, the template opens as a pop-up window which using Javascript 
shows a count of records incrementing as they are written across the network 
to the .csv file. Before we upgraded from CF5 to CFMX 7, the records were 
sent across the network in time with the Javascript counter. The file being 
written to would grow incrementally. Now however, after our upgrade to CFMX 
7 the file is not being written to until the counter in the pop-up has 
finished it's count. So it now takes literally twice as long for the .csv 
file to be written to.

Can anyone explain the change in behavior in the <CFFILE> tag from 
ColdFusion 5 to ColdFusion MX7? Macromedia documentation does not indicate 
any difference when using the action = "append" attribute as we are.

We do recognize that even if the template was still executing as we wanted 
it to, there are major performance issues here, with pulling data from the 
SQL Server and then sending it right back to a .csv file on the same server. 
For the time being though, we want to avoid doing a major code rewrite.

Thanks very much in advance for any help on this.  What I believe to be 
relevant code is appended below.

- Mike


<cfset StartTime = timeformat(now(),"HH:MM:SS")>


*SNIP*


<cfflush>
<script LANGUAGE = "JavaScript" type="text/javascript">
function display(records,count){
  MainFrm.Records.value = count + ' of ' + records + ' processed';
}
function ThisTime(StartTime,EndTime){
  MainFrm.Time.value = 'Start:' + StartTime + ' Checkpoint: ' + EndTime;
}
</script>
<cfoutput>
<script LANGUAGE = "JavaScript" type="text/javascript">
  display('#rosterdata.recordcount#','0');
ThisTime('#StartTime#', '#timeformat(now(),"HH:MM:SS")#');
</script>
</cfoutput>
<cfflush>


*SNIP*


<cfif rosterdata.currentrow mod 100 is 0>
    <cfoutput>
  <script LANGUAGE = "JavaScript" type="text/javascript">
    display('#rosterdata.recordcount#','#rosterdata.currentrow#');
   ThisTime('#StartTime#', '#timeformat(now(),"HH:MM:SS")#');
  </script>
  </cfoutput>
  <cfflush>
</cfif>


*SNIP*


<cfloop query="GetTempTable2Data">
<cfloop list="#ListOfColumns#" index="i">
   <cfif Len(Trim(GetTempTable2Data["#i#"][#counte#]))>
    <cfset outline = ListAppend(outline, GetTempTable2Data["#i#"][#counte#], 
"|")>
   </cfif>
  </cfloop>
<cfset counte = counte + 1>
  <cfif Len(Trim(outline))>
<cfset l_Columns = Replace(outline,  "|",  ",", "ALL")>
  <cffile ACTION="Append"
    FILE="#filename#"
    OUTPUT="#l_Columns#">
<cfset l_Columns = "">
  </cfif>
<cfset outline = "">
</cfloop>
</cfif>
<cfoutput>
<script LANGUAGE = "JavaScript" type="text/javascript">
  display('#rosterdata.recordcount#','#rosterdata.recordcount#');
ThisTime('#StartTime#', '#timeformat(now(),"HH:MM:SS")#');
</script>
</cfoutput>
<cfdirectory directory="#docroot##secure.councilid#\" 
filter="roster_#secure.uid#.csv" name="dir">
<p align="center">
<a onclick="javascript:window.close();" 
href="<cfoutput>#urlname#</cfoutput>" target=_blank><img 
src="/code/images/excel.gif" border="0"></a>&nbsp;<span 
class="table_field">(<cfoutput>#numberformat(dir.size)#</cfoutput> bytes) 
Click icon for Excel csv file.</span>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:221227
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to