• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF Reporting using objects

Guest
Dec 05, 2013 Dec 05, 2013

Copy link to clipboard

Copied

I already have a very complex dynamic query the displays a list on the webpage. Now I need to pass this result set as object or csv or xml to CFR and produce a report.

how to do this?

Views

578

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 05, 2013 Dec 05, 2013

Copy link to clipboard

Copied

Hi jolakammu,

You may try something like the below code:-

<cfquery name = "query_name" dataSource = "db_name">

     select * from table_name

</cfquery>

<cfspreadsheet

                                             action = "write"

                                             filename="AgentReport.xls"

                                             query="query_name"

                                             overwrite="true">

<cfform>

      <input type="button" value="Report Download" onClick="window.location.href='AgentReport.xls'">

</cfform>

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2013 Dec 05, 2013

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 09, 2013 Dec 09, 2013

Copy link to clipboard

Copied

LATEST

Here this is a simple example of generating report using query object by "cfreport" tag and report template.

http://coldfusion-tip.blogspot.com/2013/11/using-coldfusion-report-template-to.html

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:

http://cflib.org/udf/CSVToQuery

http://www.bennadel.com/blog/501-Parsing-CSV-Values-In-To-A-ColdFusion-Query.htm

For more knowledge about ColdFusion reporting please refer following links:

https://learn.adobe.com/wiki/display/coldfusionen/cfreport

http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-6fc2.htm...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation