3

In my main table, I have a fairly complex query pulling 2 kinds of data and displaying them in one grid. Currently, if the user clicks on a value, they will be able to drill down into a breakdown of the data they clicked on. The problem is that I can only display data for one of the types of data.

I would like to display a breakdown of the other type but it would require displaying on a different report using similar parameters. I am looking for a way to pass parameters to sub-reports based on the contents of what I am clicking. For example (In the action expression) I have tried this:

=IIf(Fields!Type.Value = "Job", "/Production Planning/SupportReports/Job_Plan_Board_Job_BD_v1 & Parameters!ReqByDate.Value", "/Production Planning/SupportReports/Job_Plan_Board_Plan_BD_v1 & , Parameters!ReqByDate2.Value")

The parameter values are not passing. - I am pretty sure it is syntax as I have already tried everything I could think of with the parameter expressions...

Pedram
  • 6,256
  • 10
  • 65
  • 87
tvoytko
  • 93
  • 1
  • 6
  • If it is coming from same data set (query), you probably don't need subreport. Can you show your result set from dataset and show a mockup of what you want to achieve. – Anup Agrawal Sep 15 '15 at 21:43
  • I found my answer in the expression buttons used to turn the parameter on or off in the action. I turned the parameter I needed for one report 'off' and the others 'on' based on the information. - I didn't notice the ability to do that before I asked the question. Thanks! – tvoytko Nov 10 '15 at 12:38

1 Answers1

2

If your fields are correct, you just need to fix your syntax. You parameters need to be outside of the quotes so the value can be appended to the string.

=IIf(Fields!Type.Value = "Job", 
"/Production Planning/SupportReports/Job_Plan_Board_Job_BD_v1" & Parameters!ReqByDate.Value, 
"/Production Planning/SupportReports/Job_Plan_Board_Plan_BD_v1" & Parameters!ReqByDate2.Value)

If the Type = Job and the ReqDate is 09152015 then the subreport name (? - not sure what) would be /Production Planning/SupportReports/Job_Plan_Board_Job_BD_v109152015.

Now that I think of it, you could shorten this a little bit:

="/Production Planning/SupportReports/Job_Plan_Board" &  
 IIf(Fields!Type.Value = "Job", 
 "Job_BD_v1" & Parameters!ReqByDate.Value, 
 "Plan_BD_v1" & Parameters!ReqByDate2.Value)
Hannover Fist
  • 10,393
  • 1
  • 18
  • 39