Skip to main content
Inspiring
August 29, 2007
Question

cfreportparam query & subreport

  • August 29, 2007
  • 1 reply
  • 885 views
Hi,

I'm trying to use the new query and subreport paramaters for the cfreportparam tag and i'm getting the follwing error message

Error evaluating expression : Source text : daquery.FIELD1


The error occurred in C:\ColdFusion8\wwwroot\reports\rep_test.cfm: line 39

37 :
38 : <cfreport template="nick_rep.cfr" format="HTML" query="#mquery#">
39 : <cfreportparam subreport="SubRep1" query="#daquery#">
40 : </cfreport>

Below is the code i'm using to run the report.

<cfset mquery=QueryNew("FIELD1,FIELD2","Varchar,Varchar")>

<cfset temp=QueryAddRow(mquery,1)>

<cfset temp=QuerySetCell(mquery,"FIELD1","Joe Bloggs",1)>
<cfset temp=QuerySetCell(mquery,"FIELD2","Developer",1)>

<cfset temp=QueryAddRow(mquery,1)>

<cfset temp=QuerySetCell(mquery,"FIELD1","Frank Blahblah",2)>
<cfset temp=QuerySetCell(mquery,"FIELD2","Developer",2)>

<cfset temp=QueryAddRow(mquery,1)>

<cfset temp=QuerySetCell(mquery,"FIELD1","X Y Z",3)>
<cfset temp=QuerySetCell(mquery,"FIELD2","Developer",3)>

<cfset daquery=QueryNew("FIELD1,FIELD2","Varchar,Varchar")>

<cfset temp=QueryAddRow(daquery,1)>

<cfset temp=QuerySetCell(daquery,"FIELD1","Kosheen",1)>
<cfset temp=QuerySetCell(daquery,"FIELD2","Resist",1)>

<cfset temp=QueryAddRow(daquery,1)>

<cfset temp=QuerySetCell(daquery,"FIELD1","Kosheen",2)>
<cfset temp=QuerySetCell(daquery,"FIELD2","Damage",2)>

<cfset temp=QueryAddRow(daquery,1)>

<cfset temp=QuerySetCell(daquery,"FIELD1","Kosheen",3)>
<cfset temp=QuerySetCell(daquery,"FIELD2","Kokopelli",3)>

<cfdump var=#mquery#>
<cfdump var=#daquery#>

<cfreport template="nick_rep.cfr" format="HTML" query="#mquery#">
<cfreportparam subreport="SubRep1" query="daquery">
</cfreport>

------

i've also tried with #'s
<cfreportparam subreport="SubRep1" query="daquery">

and get the same error.

We are new to reports and just giving this a trial and this bit would be really useful.

Any help would be great.

Thanks

This topic has been closed for replies.

1 reply

Sankaram
Adobe Employee
Adobe Employee
September 17, 2007
Could you send me your template cfr and subreport to me? I will have a look into it.
My id --> sankaram@adobe.com

Thnx
Sankaram.