locked
pass parameter to sub report RRS feed

  • Question

  • I have a report where the user selects a data range with a sub report attached..... the data range on the main report feeds the main report and the sub report links to the item number of the main report and pulls back revenue.....  If i wanted to pass the date range selected parameter to the sub report so i can calculate revenue by date range (the values supplied on the main report....) how could this be accomplished.  passing the parameters that were netered on the main report to the query parameters on the sub report?

    Thanks in advance

    Thursday, March 1, 2012 9:25 PM

Answers

  • If you are using 2008R2 you may not need to use a subreport. Instead create a new dataset passing the date parameters and use the Lookup function to get the value you are looking for.  Will save the subreport running for each row of the main report.

    Otherwise the way Jeevan described is how to pass values to a subreport, except the Names should match the parameter names of the subreport.

    • Marked as answer by SBolton Tuesday, March 6, 2012 2:33 PM
    Tuesday, March 6, 2012 1:50 AM

All replies

  • Hi Bolton,

    In your main report right click on the Item number and goto text box properties and goto Action.

    1) select go to report (Radio Button)

    2) Specify a report : Select your Sub report

    3) Click on the Add button

    4) Name : Itemnumber  value : Fields!Itemnumber.value

    5) again click on the Add button

    (when you say Date Range I assume StartDate and EndDate ??)

    6) Name : Itemnumber  value : Parameters!StartDate .value  

    7) repaeat step 5

    8)Name : Itemnumber  value : Parameters!EndDate .value  

    I hope this will help you. Pass these parameters in you Sub report dataset.


    Dasari

    • Proposed as answer by Zilong Lu Monday, March 5, 2012 8:53 AM
    • Unproposed as answer by SBolton Monday, March 5, 2012 4:14 PM
    Thursday, March 1, 2012 11:17 PM
  • This does not function as i was expecting.  in this case the user will have to click on each serial number (sorry i meant serial number not item number) to get the period revenue.  I was expecting the main report to pass the values (serial number, date range) to the sub report and have all the values displayed on one report.


    • Edited by SBolton Monday, March 5, 2012 4:18 PM
    Monday, March 5, 2012 4:16 PM
  • Hi,

    I think Jeevan solutuion will work for you, otherwise  Can you post some screen shot layout of your output ?



    Hope this will help you !!!
    Sanjeewan

    Monday, March 5, 2012 4:23 PM
  • Sure...  

    Here is the screen shot of the output,  My goal is to populate the period rev. with the same query used on US Dollar Rev total BUT limit it to the start date and end date the user selects.

    Monday, March 5, 2012 4:49 PM
  • Hi Boltan,

    As per my understanding

    1. Insert a new row below

    2. Merge it in two column and in Second column place your sub Report

    3. then right click on sub report and pass your parameter.

    4. where you currently placed your sub report place expression for your columns.  



    Hope this will help you !!!
    Sanjeewan

    Monday, March 5, 2012 5:10 PM
  • If you are using 2008R2 you may not need to use a subreport. Instead create a new dataset passing the date parameters and use the Lookup function to get the value you are looking for.  Will save the subreport running for each row of the main report.

    Otherwise the way Jeevan described is how to pass values to a subreport, except the Names should match the parameter names of the subreport.

    • Marked as answer by SBolton Tuesday, March 6, 2012 2:33 PM
    Tuesday, March 6, 2012 1:50 AM