You may try something like the below code:-
<cfquery name = "query_name" dataSource = "db_name">
select * from table_name
action = "write"
<input type="button" value="Report Download" onClick="window.location.href='AgentReport.xls'">
May be I was not clear on my question. Now how to pass this data to a coldfusion report and generate nice looking (header, footer, body, bolding , page number, grouping etc) report as pdf. Thanks.
I mean, how to make this csv as a datasource and create a report template (.cfr)
Here this is a simple example of generating report using query object by "cfreport" tag and report template.
If you want to use a CSV data in report template then I think you need to convert CSV into Query object then follow the process descriobed in the above URL.
For CSV to Query coversion, you may refrer following links or you can write your own functon:
For more knowledge about ColdFusion reporting please refer following links: