![](/img/trans.png)
[英]With the ReportViewer Control for SQL Server Reporting Services, can I change the subreport programatically in C#?
[英]Reporting Services C# Collapsible Detail Subreport in Row Passing Parameters
我有一個報告,其網格內需要顯示每一行的詳細信息。 在主報表的數據行下方,我有一個子報表,其中列出了該行的一些詳細信息。 通過單擊“父行”中的字段/文本框,可以將其隱藏或顯示。
我需要使用父數據中的字段值來填充每個詳細信息行。 到目前為止,我無法傳遞此值,並且我收到以下錯誤消息:
位於以下位置的子報表“ SiteProfileRate”的數據檢索失敗:
如果有人能指出正確的方向,我將不勝感激。
感謝您提供的所有幫助和幫助!!!
好像我拼湊了起來...對於那些感興趣的人,這對我有用
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;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.