Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Subreport Error

Author  Topic 

mrm23
Posting Yak Master

198 Posts

Posted - 2010-04-19 : 04:40:45
Hi All,

I am need of urgent help .
I have a master-detail report in which the main report calls a subreport. The subreport query is something like:

select hu.username,hc.clientname
,hr.reqtitle
,(select Count(HC_REQ_RESUME.RID)
from HC_REQ_RESUME JOIN HC_USERS ON HC_REQ_RESUME.CreatedUser=hu.RID
and HC_REQ_RESUME.CreatedDate between (@fromdate ) and (@todate)
AND HC_REQ_RESUME.ReqID in(Select RID
From HC_REQUISITIONS
WHERE HC_REQUISITIONS.ClientID in (16,15,13,14 ))) as 'Resumes'
from hc_clients hc
join hc_requisitions hr on hc.rid = hr.clientid
join hc_users hu on hu.rid = hc.createduser
and hu.rid in (@rid)

In the calling report, i am passing @rid. now how to pass the @fromdate and @todate params? if i dont take them in my query, i am afraid i may not get the desired result set. Coz, i have used the same parameters to get main report.

how to go about this?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-19 : 05:12:37
do you have fromdate and todate values aviable from your main report? or do you need to generate values on the fly?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

mrm23
Posting Yak Master

198 Posts

Posted - 2010-04-19 : 05:21:31
no they are available in the main report. based on that i must see the detail report.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-19 : 05:25:08
then isnt it just a matter of passing them through in drillthrough tab as =Parameters!param1.value and etc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

mrm23
Posting Yak Master

198 Posts

Posted - 2010-04-19 : 05:28:46
will they be non-queried? or should i create a dataset for rid parameter as i did in master report?
explain little more if you dont mind.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-19 : 05:39:17
quote:
Originally posted by mrm23

will they be non-queried? or should i create a dataset for rid parameter as i did in master report?
explain little more if you dont mind.


Since you've already parameters in main report having values for start and end date its just of matter of including them in places where you need to pass the value by just including expression like below

=Parameters!StartDate.value
=Parameters!EndDate.value

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

mrm23
Posting Yak Master

198 Posts

Posted - 2010-04-19 : 05:57:43
i have to do this in the sub-report isn't it? i have made those changes, but still i am getting error.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-19 : 11:27:23
do you mean you're using subreport container?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -