Thanks for the tips on this.
I found this working codes below, but need to know how to put all of
the output into Excel files with the column names.
<cfset tbls = "Demo,FuncAbility, ...">
<cfoutput>
<cfloop list="#tbls#" index="i">
<cfquery datasource="GKeeper" name="qryTable">
select *
from #i#
</cfquery>
<cfif qryTable.RecordCount>
<cfset ColList = qryTable.ColumnList>
<cfloop list="#ColList#" index="j">
#j#<br />
<cfloop query="qryTable">
#qryTable[j][CurrentRow]#
</cfloop><br />
</cfloop>
</cfif>
</cfloop>
</cfoutput>
Any ideas on this, please?
Thanks much
On Jan 25, 2008 5:51 AM, Dominic Watson <[EMAIL PROTECTED]> wrote:
> For each table, something like:
>
> <cfloop query="ExportData">
>
> <cfloop list="#ExportData.columnList#" index="col"> <!--- columnList is a
> variable that is present in every query - a comma seperated list of column
> names --->
> <cfset output = output & #ExportData[col]# & ' '> <!--- this will need to
> change to reflect the way you are making the excel file --->
> </cfloop>
>
> <cfset output = output & chr(13) & chr(10)> <!--- I wouldn't do a file
> append on each loop, just keep building the string and add a line break to
> it --->
> </cfloop>
>
> <cffile action="write" file="#tempfile#" output="#output#"
> nameconflict="overwrite">
>
> <cfmail ...>
> <!--- not sure how you attach a file offhand, look it up! --->
> </cfmail>
>
> <!--- no need to delete the file, because you can choose to overwrite it the
> next time you run the process. Easy to delete tho: --->
> <cffile action="delete" file="#tempFile#">
>
> Dominic
>
> -- Blog it up: http://fusion.dominicwatson.co.uk
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297513
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4