Linking Subreports to Your Main Report
admin
When you create a report with a simple query the output is contolled by the query. prefix. So for example if we pull the firstname and lastname from the employee table we would output the emplyee name like this:query.firstname query.lastname
It's a little different than standard ColdFusion because we don't really define a cfquery name="foo" and use the foo as the prefix. So the problem comes when you run subreports and try to use query.employeeID in the subreport to say pull payroll info from the payroll table:
Select t1.salary, t1.paydate
From payroll t1
Where t1.employeeID = #query.employeeID#
The frustration is that the failure is a bit ambiguous because the message will state that query.employeeID is undefined. The thing to remember is that items you are passing in from another query are param. prefixes. So this will work given you have assigned employeeId as an input variable in the properties box in the main report:
Select t1.salary, t1.paydate
From payroll t1
Where t1.employeeID = #param.employeeID#
Thanks Jim Bambrough for the help. His longer example is here: http://www.adobe.com/devnet/coldfusion/articles/subreport.html
Posted in ColdFusion Report Builder 8 |
4 comments
Aug 28, 2009 at 5:25 AM
Good afternoon. The first duty of a leader is to make himself be loved without courting love. To be loved without 'playing up' to anyone - even to himself. Help me! Help to find sites on the: Discounted designer perfumes. I found only this - <a href="http://ssa.nic.in/Members/Perfumes/discount-perfumes-tiffany">discount perfumes tiffany</a>. Perfumes at discount savings: in this period of exchanging of product and feature, the name-brand of brands is treated with the furnishing of driveway and room. Perfumes at discount savings: in this period of exchanging of product and feature, the name-brand of brands is treated with the furnishing of driveway and room. Thanks :-). Arnon from Burma.
Aug 29, 2009 at 11:56 PM
Good Day. This is my first time visiting this site and I found it very informational as a whole. I am so delighted in finding your website. Help me! There is an urgent need for sites: Handmade soap pure caribbean spa. I found only this - <a href="http://www.saeon.ac.za/Members/Soap/what-is-handmade-soap">what is handmade soap</a>. high end luxury handmade soap. Trial is the boom of employing a laser onto a different, sometimes fretless area, by realizing posters into it. Thank :confused: Abraham from Malaysia.
Oct 31, 2009 at 4:59 AM
I needed this info thanks mate
Nov 19, 2009 at 4:04 AM
i have posted your blog on my site