3 Replies - 2954 Views - Last Post: 08 February 2011 - 01:21 PM Rate Topic: -----

#1 Guest_James McGuiness*


Reputation:

ColdFusion Report Builder - Acess To Query

Posted 08 February 2011 - 01:08 PM

Hi,

<cfreport template="../Report_Templates/#Form.Report#" query="#pdfgen#" format="pdf" >
<CFREPORTPARAM NAME="ReportFromPeriod" VALUE="#form.From_Period#">
<CFREPORTPARAM NAME="ReportToPeriod"   VALUE="#form.to_Period#">
</cfreport>



I am creating a query in CF, then passing it into my Report Builder. My question is, I would like to be able to run a query of query against the query I am passing in.

So in a report function, I would like to do a query of query:
<cfquery dbtype="query" name="qGettotrecs">
Select somename [b]from pdfgen[/b]
where id = 86
</cfquery>

<cfreturn "#qGettotrecs.somename#">
Select * from pdfgen where id = 1


Is that possible?... Or is there some other way I can work with the query I pass in?

Thanks
-Jim

This post has been edited by macosxnerd101: 08 February 2011 - 01:09 PM
Reason for edit:: Please use code tags


Is This A Good Question/Topic? 0

Replies To: ColdFusion Report Builder - Acess To Query

#2 JimMcGuiness  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 23-January 11

Re: ColdFusion Report Builder - Acess To Query

Posted 08 February 2011 - 01:11 PM

Hi,

<cfreport template="../Report_Templates/#Form.Report#" query="#pdfgen#" format="pdf" >
<CFREPORTPARAM NAME="ReportFromPeriod" VALUE="#form.From_Period#">
<CFREPORTPARAM NAME="ReportToPeriod"   VALUE="#form.to_Period#">
</cfreport>



I am creating a query in CF, then passing it into my Report Builder. My question is, I would like to be able to run a query of query against the query I am passing in.

So in a report function, I would like to do a query of query:

<cfquery dbtype="query" name="qGettotrecs">
Select somename from pdfgen
where id = 86
</cfquery>

<cfreturn "#qGettotrecs.somename#">

Is that possible?... Or is there some other way I can work with the query I pass in?

Thanks
-Jim

This post has been edited by JimMcGuiness: 08 February 2011 - 01:13 PM

Was This Post Helpful? 0
  • +
  • -

#3 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10767
  • View blog
  • Posts: 40,093
  • Joined: 27-December 08

Re: ColdFusion Report Builder - Acess To Query

Posted 08 February 2011 - 01:14 PM

Duplicate threads merged. Please avoid duplicate posting.
Was This Post Helpful? 1
  • +
  • -

#4 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1947
  • View blog
  • Posts: 3,488
  • Joined: 13-January 08

Re: ColdFusion Report Builder - Acess To Query

Posted 08 February 2011 - 01:21 PM

Ah. You're essentially asking if you can do a QofQ against a dynamic query name?

I've never tried. Have you tried this yet? I suspect that's really the issue...not that you're in a report builder etc.

What you COULD do is to do a QofQ BEFORE you the CFREPORT call and pass in a generically named query resultset so that within the report you could refer to the query name explicitly. That is, somewhere in the body of the page containing the CFREPORT call you apparently have an option to have queries named several different things. If you converted all of those to a generically named query before calling the report tag, you can pass in the generic query name.

Did that make sense? If not, feel free to post up the code for the entire page (not the report page itself but the caller) and I can prolly explain a little better.

Good luck!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1