cfdeveloper
Programmer
Hello everybody,
I've written this code that exports the search results to a csv file. Here is the code:
<CFFILE ACTION="Write"
FILE="searchResults.csv"
ADDNEWLINE="Yes"
OUTPUT="Date, Ref, Name #Chr(10)##Chr(10)#">
<CFSET QUOTE = Chr(127)>
<cfoutput query="qSearch">
<CFSET log_string = QUOTE & LogTime & QUOTE & ","
& QUOTE & Reference & QUOTE & ","
& QUOTE & FirstName & QUOTE>
<CFFILE ACTION="Append"
FILE="searchResults.csv"
ADDNEWLINE="Yes"
OUTPUT="#log_string#">
</cfoutput>
<CFHEADER NAME="Content-Type" VALUE="application/unknown">
<CFHEADER NAME="Content-Disposition" VALUE="inline; filename=searchResults.csv">
<CFCONTENT TYPE="application/msexcel" FILE="searchResults.csv" deletefile="Yes">
I was wondering if its possible that when the display the header information (Date, Ref, Name)
with some background colour formatting to the text.
So for example when the above code is executed, the .csv file opens up with 3 columns:
Date Ref Name
20/08/2004 T123345 Joe Bloggs
Can I specify something in the code to for example make the header text colour to blue. If yes,
can someone please show me the code or give me some tips.
Best regards
cfcoder
I've written this code that exports the search results to a csv file. Here is the code:
<CFFILE ACTION="Write"
FILE="searchResults.csv"
ADDNEWLINE="Yes"
OUTPUT="Date, Ref, Name #Chr(10)##Chr(10)#">
<CFSET QUOTE = Chr(127)>
<cfoutput query="qSearch">
<CFSET log_string = QUOTE & LogTime & QUOTE & ","
& QUOTE & Reference & QUOTE & ","
& QUOTE & FirstName & QUOTE>
<CFFILE ACTION="Append"
FILE="searchResults.csv"
ADDNEWLINE="Yes"
OUTPUT="#log_string#">
</cfoutput>
<CFHEADER NAME="Content-Type" VALUE="application/unknown">
<CFHEADER NAME="Content-Disposition" VALUE="inline; filename=searchResults.csv">
<CFCONTENT TYPE="application/msexcel" FILE="searchResults.csv" deletefile="Yes">
I was wondering if its possible that when the display the header information (Date, Ref, Name)
with some background colour formatting to the text.
So for example when the above code is executed, the .csv file opens up with 3 columns:
Date Ref Name
20/08/2004 T123345 Joe Bloggs
Can I specify something in the code to for example make the header text colour to blue. If yes,
can someone please show me the code or give me some tips.
Best regards
cfcoder