ReportViewer 後台,代碼控制報表.
private void button1_Click(object sender, EventArgs e)
{
ReportDataSource reportdatasource1 = new ReportDataSource();
reportdatasource1.Name = "perDataSet1_per_Structure_View";
reportdatasource1.Value = this.DataBlockSet.DataSource.Tables["baseDataBlock1"];
this.reportViewer1.LocalReport.DataSources.Add(reportdatasource1);
this.reportViewer1.LocalReport.ReportEmbeddedResource = "Lerado.Modules.Per.Forms.ReportView.Report3.rdlc";
this.reportViewer1.RefreshReport();
}