Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>Create CSV files in client's mechine </b>

Status
Not open for further replies.

kann

Programmer
Feb 16, 2000
25
0
0
US
Hi all,
In my application User has to download report in the form of csv file. This report is dynamically generated depend on
the selection criteria. For this i have used the following code:
<CFSETTING ENABLECFOUTPUTONLY=&quot;Yes&quot;>
<CFCONTENT type=&quot;application/csv.ms-excel&quot;>
<!-- from here the data is retrived from CFlist-->
<CFSETTING ENABLECFOUTPUTONLY=&quot;NO&quot;>

When i try to use &quot;,&quot; in the code to separate cells, The browser is not recognising. If i use Tabs in my code, it is working fine in open mode(file dialog) but not recognise
in save mode(file dialog). And also i have to change system registry in Windows NT by adding content type. I can't change system registry in all clients mechines.

Is there any way i can create csv file with out need of client settings and also get same result for Open and save modes.
thanks
kann

 
I made this last night to generate a CSV file used in importing Contacts into Outlook.
-----------------------------------------------------------
<CFSET savefilename=&quot;Accounts.csv&quot;>

<cflock timeout=&quot;60&quot; throwontimeout=&quot;Yes&quot; name=&quot;MakeFile&quot; type=&quot;EXCLUSIVE&quot;>

<cffile action = &quot;write&quot;
file = &quot;e:\#savefilename#&quot;
output = &quot;E-Mail,Name,Business Phone,Company,Job Title&quot;>

<cfoutput query=&quot;MakeList_Query&quot;>
<cffile action = &quot;append&quot;
file = &quot;e:\#savefilename#&quot;
output = &quot;#EMAIL#,#NickName# #LastName#,#workphone#,#Company#,#JobTitle#&quot;>
</cfoutput>

</cflock>
<CFOUTPUT>
<a href=&quot;#savefilename#&quot; title=&quot;Download and Import into Outlook&quot;><b>#savefilename#</b></a><br>

#MakeList_Query.RecordCount# Records Added
</CFOUTPUT>
-----------------------------------------------------------

Works like a Champ!
Made it last night a 1am.

Let me know if it helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top