2012-01-16 42 views
0

我有一個報告,在其網格內需要顯示每行的詳細信息。 在主報告的數據行下方,我有一個子報表,列出了該行的一些詳細信息。 隱藏或通過單擊「父行」中的字段/文本框顯示。報告服務C#在行傳遞參數中可摺疊細節子報表

我需要使用父數據中的字段值來填充每個詳細信息行。 到目前爲止,我還沒有能夠通過這個值,我收到此錯誤信息:

數據檢索失敗的報表,「SiteProfileRate」,位於:

如果任何人都可以在點我正確的方向,我非常感謝幫助。

感謝您的任何幫助和幫助!

回答

0

貌似我拼湊一起... 對於那些有興趣,這是對我工作......

this.ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubreportProcessingEvent); 

    void SubreportProcessingEvent(object sender, SubreportProcessingEventArgs e) 
    { 
     SqlDataAdapter sda = new SqlDataAdapter(); 
     DataSet ds = new DataSet(); 

     ds = getSubReportData(e.Parameters[0].Values[0]); 
     ReportDataSource rds = new ReportDataSource("SqlDataSourceProg", ds.Tables["SiteProfileSvcRate"]); 

     rds.Name = "SiteProfileSvcRate"; 

     e.DataSources.Add(rds); 
    } 

    private DataSet getSubReportData(string strSvcId) 
    { 
     DataSet ds = new DataSet(); 
     SqlParameter[] sParam = new SqlParameter[1]; 

     sParam[0] = new SqlParameter("svcid", strSvcId); 
     ds = dac.GetDataSet("xwiWR_SP_SiteProfile_SvcRate_Current", sParam, "SiteProfileSvcRate"); 

     return ds; 
    }