2012-04-11 8 views
3

ich einen rdlc Bericht Name attendence.rdlc haben, die drei Parameter employeeId nehmen, monthID und Jahr Mitarbeiter monatlichen Anwesenheits status.Like enter image description hereAufruf Drillthrough- Bericht in rdlc

zu erzeugen, wenn ich auf >> Schaltfläche Like: enter image description here

Ich muss Drillthrough aufrufen (in meinem Fall gleichen Bericht) melden zunehmenden Monat und Jahr Parameter.

enter image description here

Wie ein Drillthrough- auch Handler in rdlc Bericht erstellen?

Antwort

3

Mein Problem haben solved.In rdlc gewesen, wenn jemand goto_report/goto_url..it calling tatsächlich von Drillthrough- report.So genannt, wenn ich wie

außerhalb von Postback-URL na sogar Handler offensichtlich erstellen
protected void Page_Load(object sender, EventArgs e) 
{ 

if (!IsPostBack) 
    { 
     //otherscode u need 
     //now call report first time 
     string path = HttpContext.Current.Server.MapPath(your report path); 
     ReportViewer1.Reset(); //important 
     ReportViewer1.ProcessingMode = ProcessingMode.Local; 
     ReportViewer1.LocalReport.EnableHyperlinks = true; 

     LocalReport objReport = ReportViewer1.LocalReport; 
     objReport.DataSources.Clear(); 
     objReport.ReportPath = path; 

     // Add Parameter if you need 
     List<ReportParameter> parameters = new List<ReportParameter>(); 
     parameters.Add(new ReportParameter("parameterName", ParameterValue)); 
     ReportViewer1.LocalReport.SetParameters(parameters); 
     ReportViewer1.ShowParameterPrompts = false; 
     ReportViewer1.ShowPromptAreaButton = false; 
     ReportViewer1.LocalReport.Refresh(); 

     //Add Datasourdce 
     ReportDataSource reportDataSource = new ReportDataSource(); 
     reportDataSource.Name = "odsReportData"; 
     reportDataSource.Value = YourReportDataSourseValue; 
     objReport.DataSources.Add(reportDataSource); 
     objReport.Refresh(); 
    } 

    ReportViewer1.Drillthrough += new DrillthroughEventHandler(DemoDrillthroughEventHandler); 

    } 







    public void DemoDrillthroughEventHandler(object sender, DrillthroughEventArgs e) 
    { 
    /*Collect report parameter from drillthrough report*/ 
    ReportParameterInfoCollection DrillThroughValues = e.Report.GetParameters(); 
    Type parameterName = Type.Parse(DrillThroughValues[1].Values[0].ToString()); 

    /*Bind data source with report*/ 
    LocalReport localReport = (LocalReport)e.Report; 
    localReport.DataSources.Clear(); 
    localReport.DataSources.Add(new ReportDataSource("odsData", reportData)); 
    localReport.EnableHyperlinks = true;  

    /*Add parameter to the report if report have paramerter*/ 
    List<ReportParameter> parameters = new List<ReportParameter>(); 
    parameters.Add(new ReportParameter("ParameterName", ParameterValue)); 
    localReport.SetParameters(parameters); 
    localReport.Refresh(); 
} 
Verwandte Themen