【问题标题】:Report data is not displayed - WPF不显示报告数据 - WPF
【发布时间】:2010-08-19 05:20:20
【问题描述】:

我刚开始在 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;
    }

可能是什么问题?

谢谢

【问题讨论】:

    标签: c# wpf reporting-services reporting


    【解决方案1】:

    可能输出目录中没有文件Report1.rdlc?如果你在调试模式下编译,它必须在bin/debug-目录中,在发布时它必须在bin/release

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

    【讨论】:

    • 谢谢...选得好..现在我设置了这样的 reportViewer.LocalReport.ReportPath = "../../Report1.rdlc";
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多