views:

25

answers:

1

Hi, I have just started to make report in wpf, but getting following error

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'

here is my code

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;
    }

What could be the issue?

Thanks

+1  A: 

Maybe in the output directory is no file Report1.rdlc? If you compile in debug mode, it must be in the bin/debug-directory, in release it must be in bin/release.

If this is the problem, look at this post. Probably it will help.

HCL
Thanks... well picked.. now I have set like this reportViewer.LocalReport.ReportPath = "../../Report1.rdlc";
Muhammad Akhtar