0
我得到的錯誤是微軟報表查看器使用鑽取多個數據源
我有2種數據源,AssetSummaryDataSet和AssetLatencyCompleteDataSet
「數據源實例尚未爲數據源‘AssetLatencyCompleteDataSet_fsAssetLatencyComplete’提供」我只能選擇1個數據實例,我環顧四周,似乎應該可以爲單個報表添加其他數據源,並且它們將填充在此處顯示的報表查看器控件中。
我創建了DrillThrough處理程序,但是我仍然遇到上述錯誤。
如何將缺少的數據源實例添加到報表查看器中?
{
public partial class frmAssetSummaryRpt : Form
{
public frmAssetSummaryRpt()
{
InitializeComponent();
}
private void frmAssetSummaryRpt_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'assetSummaryDataSet.fsAssetRecoverySummaryByClientWO' table. You can move, or remove it, as needed.
this.fsAssetRecoverySummaryByClientWOTableAdapter.Fill(this.assetSummaryDataSet.fsAssetRecoverySummaryByClientWO);
reportViewer1.Drillthrough += new DrillthroughEventHandler(reportDrillthroughEventHandler);
this.reportViewer1.RefreshReport();
}
void reportDrillthroughEventHandler(object sender, DrillthroughEventArgs e)
{
LocalReport localReport = (LocalReport)e.Report;
localReport.DataSources.Add(new ReportDataSource("fsAssetLatencyComplete", (object)assetLatencyCompleteDataSet.fsAssetLatencyComplete));
}
private void button1_Click(object sender, EventArgs e)
{
frmAssetLatencyFullRpt AssetLatencyFullReport = new frmAssetLatencyFullRpt();
AssetLatencyFullReport.Show();
}
}
}