none
Get hold of Reportparameters RRS feed

  • Question

  • I have a report - A - showing customer number, names ect. ect  in a reportviewer.

    When I click one of the customer numbers I want to show another report - B - in the same reportviewer showing some data about this specific customer.

    I have set up all the navigation by clicking and filling out forms including setting a parameter - DebNr - in report B - I did set it equal to Fields!ACCOUNT.Value

    When I want to show the B-report in the same reportviewer I think I have to define a datasource to get the data, BUT to do this I have to know the value of the parameter DebNr.

    DebNr = ?????????????????????????????????
    rds = new ReportDataSource("DataSet_DrillDown_KSO_DrillDown_O4",KSO_DrillDown_O4TableAdapter.GetData(fraDato, tilDato,DebNr));
    localReport.DataSources.Add(rds);

    How can I get hold of the value of the customer number on which the user did click in the A-report ?

    Tuesday, December 9, 2008 11:10 AM

Answers

  • The problem in your code is that you are reading the parameter from the main report, not the drillthrough report.  You should be calling GetParameters on the Report in the eventargs, not ReportViewer.LocalReport.
    • Marked as answer by PSAKSor Wednesday, January 14, 2009 7:27 AM
    Wednesday, January 14, 2009 7:03 AM
    Moderator

All replies

  • It LOOKS like:

    "I have set up all the navigation by clicking and filling out forms including setting a parameter - DebNr - in report B - I did set it equal to Fields!ACCOUNT.Value"

    does NOT work = NO value is transfered from the "cell" I click on to the parameter in the report B !

    The "Fields!ACCOUNT.Value" is the value shown in the "cell" of report A and it's there - I can see it .... 2110002 !

    but WHY is it NOT transfered to the parameter of report B when I click on the "cell" ?

    Best regards
    KSor, Denmark

     


    Monday, January 12, 2009 8:48 AM
  • It's not clear from your post, so I just want to make sure that you are supplying the data for report B by handling the Drillthrough event on the ReportViewer.  Are you saying that calling Report.GetParameters() on the the report in the the drillthrough eventargs does not contain the parameter value you are looking for?  If that is the case, would you post your RDLC files so that we can take a look?

    Monday, January 12, 2009 4:07 PM
    Moderator
  • I minimize the amount of code so I just use the posibility to

    1) Right click on the cell with the customer number in the report
    2) Choose properties
    3) Choose the TAB Navigation
    4) Choose Jump to report
    5) Point out the report I want to show customers info in
    6) Clicks on the button Parameters
    7) Set up so that I can "put" the customer number (DebNr) into parameter array with =Fields!ACCOUNT.Value

    Now I THINK that I have got the customer number FROM the cell in the first report - A - into parameters of the second report B

    In the Drillthrough-event of the ReportViewerForm I now want to extract customer number fra parameters to feed into the Tapadabter.GetData and here I use this code:

     

    1                     debNr = reportViewer1.LocalReport.GetParameters()[3].Values[0];  
    2  
    3                     rds = new ReportDataSource("DataSet_DrillDown_KSO_DrillDown_O4",  
    4                                                                      KSO_DrillDown_O4TableAdapter.GetData(fraDato, tilDato,debNr));  
    5  

    BUT in line 1 debNr is NULL and I think it should be equal to the value in the cell I clicked on in report A - right ?

    I don't think I can attach files to this message - how can I send you the RDLC-files ?

    Best regards

    Tuesday, January 13, 2009 7:22 AM
  • The problem in your code is that you are reading the parameter from the main report, not the drillthrough report.  You should be calling GetParameters on the Report in the eventargs, not ReportViewer.LocalReport.
    • Marked as answer by PSAKSor Wednesday, January 14, 2009 7:27 AM
    Wednesday, January 14, 2009 7:03 AM
    Moderator
  • That's it !

    Thanks
    Wednesday, January 14, 2009 7:28 AM