1
    private void ShowRep_Click(object sender, EventArgs e)
    {
        DataTable dt = GetSpRecord(textBox1.Text);
        this.reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
        this. reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
        this.reportViewer1.LocalReport.DataSources.Clear();
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("TestSalaryDataSet", dt));
        this.reportViewer1.LocalReport.Refresh();
    }

以上是我的代码,此时我可以看到存储过程结果显示在 datashources 中 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("TestSalaryDataSet", dt)); 但问题是我的报表查看器没有显示数据。

4

0 回答 0