locked
Why data is not getting displayed ? RRS feed

  • Question

  • User273639661 posted

    I am creating a parent and drill through report, I have successfully created and displayed parent report but failed to load DRILLTHROUGH report when I click a name in parent report.

    What I did:

    1. Defined a parameter in drillthrough report i.e. pk_PersonalInfo_ID
    2. Selected a JUMP to Report option in parent report and also defined parameter.
    3. Wrote this code:

    protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
    {
        try
        {
            LocalReport Report = (LocalReport)e.Report;
            Report.DataSources.Add(new ReportDataSource("DataSetEmployeeInfo", LoadValues(e.Report.GetParameters())));
            Report.Refresh();
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    
    }
    
    private DataTable LoadValues(ReportParameterInfoCollection c)
    {
        try
        {
    
            DataSetPersonalInfoTableAdapters.ReportEmployeeAllDataTableAdapter tba = new DataSetPersonalInfoTableAdapters.ReportEmployeeAllDataTableAdapter();
    
            return tba.GetData(Convert.ToInt32(c["pk_PersonalInfo_ID"].Values[0]));
    
    
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
            throw;
        }
    }

    also called event from report viewer but drilldown is not getting displayed. ERROR: 

    An error occurred during local report processing

     and innerEXCEPTION 

    {"The report definition for report 'EmployeesAllData' has not been specified"}

    EmployeesAllData is the name of 2nd report.

    Thursday, November 12, 2015 3:40 PM

Answers

All replies