Skip to main content
Inspiring
September 12, 2014
Answered

create Report charting data series

  • September 12, 2014
  • 1 reply
  • 1643 views

I want to add chart to my report and add a chart control on my report.

I double click on the chart and edit chart type as line chart and edit chart series.

I use Data from a fix of values and choose the field name from the drop down from my data source field name, but I got following error message.

An error occurred while trying to create a chart on this report.

Ensure that the column(s) selected for the chart series are numerical values. Error: The chart could not be generated due to an error in the graphing engine.

I tried to select from data from query. I have to build my query from report.

I use a stored procedure for this report, so I need advance to build my query, once I use the stored procedure then Report Builder warn me that it will erase all fields to recreate fileds.

I would like to know what is the right procedure to create chart for the report.

Your help and information is great appreciated,

Regards,

Iccsi

This topic has been closed for replies.
Correct answer EddieLotter

I have following code to generate the report.

mydata is source or report and getQ is the source of chart.

The report running and mydata correct on the report, but the chart does not get result from MyChartSP.

Do I have any thing wrong from the code following?

Thanks a million again for helping and information,

Regards,

Iccsi,

<cfstoredproc procedure = "MySP" datasource = "MySource">

   <cfprocparam value = "#form.MyValue#" CFSQLTYPE = "cf_sql_ineteger">

   <cfprocresult name="mydata" resultset="1">

  </cfstoredproc>

 

 

  <cfset Request.Q = getQ()>

   <cffunction name="getQ" returntype="query">

  <cfset var qq = ''>

   <cfstoredproc procedure= "MyChartSP" datasource="MySource">

   <cfprocparam value = "#form.MyValue#" CFSQLTYPE = "cf_sql_integer">

 

   <cfprocresult name="qq" resultset="1">

    </cfstoredproc>

  <cfreturn qq>

</cffunction>

  <cfreport format = "PDF" template="MyReport.cfr"  overwrite="Yes" query = "#mydata#">

 

 

  </cfreport>


Please forgive me, I never personally used the method documented in the link I provided. I have reviewed how I achieved the same thing and I did it differently.

Click on your chart in the Report Builder and in the Properties window give it a Name such as MyChart.

Then change your CFML to the following:


<cfstoredproc procedure = "MySP" datasource = "MySource">

  <cfprocparam value = "#form.MyValue#" CFSQLTYPE = "cf_sql_ineteger">

  <cfprocresult name="mydata" resultset="1">

</cfstoredproc>

<cfstoredproc procedure= "MyChartSP" datasource="MySource">

  <cfprocparam value = "#form.MyValue#" CFSQLTYPE = "cf_sql_integer">

    <cfprocresult name="MyChartData" resultset="1">

</cfstoredproc>


<cfreport format = "PDF" template="MyReport.cfr"  overwrite="Yes" query = "mydata">

  <cfreportParam chart="MyChart" series="1" query="MyChartData">

</cfreport>

See the details in the ColdFusion documentation here:

Adobe ColdFusion 9 * cfreportparam

1 reply

EddieLotter
Inspiring
September 16, 2014
iccsiAuthor
Inspiring
September 17, 2014

Thanks for your information and help,

It works to use <cfquery>, but it gets error message when I change it to cfstoreproc.

<cfset ReportQuery.Q = getQ()>

  <cfreport format = "PDF" template="MyTest.cfr"  overwrite="Yes" />

  <cffunction name="getQ" returntype="query">

  <cfset var qq = ''>

   <cfstoredproc procedure= "MyStoredProcedure" datasource="MySource"

   <cfprocparam value = "#form.MyValue#" CFSQLTYPE = "cf_sql_date">

   <cfprocresult name="mydata" resultset="1">

    </cfstoredproc>

  <cfreturn qq>

</cffunction>

Thanks again for helping,

Regards,

Iccsi

Invalid token c found on line 76 at column 5.

The CFML compiler was processing:

  • A cfstoredproc tag beginning on line 75, column 5.
  • A cfstoredproc tag beginning on line 75, column 5.
EddieLotter
Inspiring
September 17, 2014

   <cfstoredproc procedure= "MyStoredProcedure" datasource="MySource"

You are missing a closing angle-bracket on this line, however it may be a typographical error in your post.

   <cfprocresult name="mydata" resultset="1">

Change name="mydata" to name="qq" so that your function does not return an empty variable.