locked
RDLC handling multiple drillthroughs RRS feed

  • Question

  • User2147291169 posted

    Hi,

    I have multiple drillthroughs in my rdlc report and each of the child report has a datasource with it which needs to be initialized on click. 

    How can I know which element (i.e. which graph has been clicked) in the report to run the code for the specific datasource?

    In other words, if Graph 1 is clicked, I want to run Code block A in the event handler section and if Graph B is clicked in the report, I want to run Code Block B.

    How do I capture from the rdlc which graph has been clicked by the user?

    Your answers are most appreciated.

    Best Regards,

    Kayras

    Wednesday, September 4, 2013 7:58 AM

All replies

  • User1143442848 posted

    Hi,

    According to your description, you want to run CodeA if GraphA is clicked.

    I suggest you use the Parameter to jump to the related report.

    Please try to follow the steps below to add a drillthrough report link:

    1, Open the client report definition (.rdlc) file in graphical design mode.

    2, Right-click the text box or image to which you want to add a link and then click Properties.

    3, On the Navigation tab, select Jump to Report.

    4, Type or select a report name. The report must be a .rdlc file that is part of the same project.

    5, To set parameters to pass to the drillthrough report, click Parameters, and then do the following:

    In Parameter Name, type the names of the report parameters in the drillthrough report.

    In Parameter Value, type or select the values to pass to the parameters in the drillthrough report.

    Then you can go to the related report according to the parameter.

     

    For the detailed information, please try to refer to the following links:

    # Configuring Subreports and Drillthrough Reports (Visual Studio Report Designer)

    http://msdn.microsoft.com/en-us/library/ms251765(v=vs.90).aspx

    # Dynamically passing parameter to DrillThrough report in RDLC

    http://blogs.msdn.com/b/selvar/archive/2010/03/03/dynamically-passing-parameter-to-drillthrough-report-in-rdlc-part-1.aspx

     

    Best Regards,

    Lisa Zhang 

    Thursday, September 5, 2013 8:39 AM
  • User2147291169 posted

    Lisa,

    Thank you for your reply. Let me clarify using the following code snippet.

    private void rptViewer_Drillthrough(object sender, DrillthroughEventArgs e)
        {
            if (reportDataSource == "DataSourceA")
            {
                // if(Graph A Clicked)
                {
                    showReport("ReportA.rdlc", reportDataSource, "", m_currentUser.OrganisationCode);
                }
                // else if (Graph B Clicked)
                showReport("ReportB.rdlc", reportDataSource, "", m_currentUser.OrganisationCode);
            }
        }

    There is one parent report and two drillthrough reports (for 2 graphs). All three reports use the same datasource.

    At the moment my code is as below:

    private void rptViewer_Drillthrough(object sender, DrillthroughEventArgs e)
        {
            if (reportDataSource == "reportDataSource")
            {
                showReport("reportA.rdlc", reportDataSource, "", m_currentUser.OrganisationCode);
                showReport("reportB.rdlc", reportDataSource, "", m_currentUser.OrganisationCode);
            }
        }

    Even though in the report GUI under graph series properties > Action > Enable as a hyperlink: Go to report (please see attached image below) I have specified separate reports for two separate graphs, when clicked on, both graphs show the same report - report B since it is what is loaded in memory. If I have one showReport method then that report shows for both drillthroughs.

    If I could somehow get which graph were clicked, would solve my issue. Thanks.

    Attached image:

    Best Regards,

    Kayras

    Thursday, September 5, 2013 12:36 PM
  • User2147291169 posted

    Lisa,

    I do not have any parameters to pass between parent and drillthrough report. All the work is done via stored procedures. 

    Kindly advise.

    Thursday, September 12, 2013 12:32 PM