报告数据不显示 - WPF

时间:2010-08-19 05:20:21

标签: c# wpf reporting-services reporting

我刚刚开始在wpf中进行报告,但收到以下错误

An error occurred during local report processing. The report definition for report 'Project Path' has not been specified. Could not nto fild file 'File Path'

这是我的代码

private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        List<Model.TruckDriver> truckDriver   = BLL.TruckDriver.GetTruckDriversList(2);
        ReportViewer reportViewer = new ReportViewer();
        reportViewer.ProcessingMode = ProcessingMode.Local;
        reportViewer.LocalReport.ReportPath = "Report1.rdlc";

        ReportDataSource ds = new ReportDataSource("ReportViewer_Driver", truckDriver);
        reportViewer.LocalReport.DataSources.Add(ds);
        reportViewer.RefreshReport();
        windowsFormsHost1.Child = reportViewer;
    }

可能是什么问题?

由于

1 个答案:

答案 0 :(得分:1)

也许在输出目录中没有文件 Report1.rdlc ?如果在调试模式下编译,它必须位于 bin / debug 目录中,在发行版中它必须位于 bin / release 中。

如果这是问题,请查看this帖子。可能会有所帮助。