如何在本地报表处理期间设置可与安装程序绑定的WPF中的报表定义的路径

如何在本地报表处理期间设置可与安装程序绑定的WPF中的报表定义的路径,wpf,Wpf,本地报表处理时如何设置报表的文件路径 Tbl_SensorDataSet是具有Tbl_SensorDataSetTableadapter的数据集 使用ReportEmbeddedResource而不是ReportPath,因为ReportPath查找文件存在,而ReportEmbeddedResource将程序集资源作为完全限定的对象名查找 以下是示例: report.ReportEmbeddedResource = full Namespace.report.rdlc 这是.\u repor

本地报表处理时如何设置报表的文件路径

Tbl_SensorDataSet是具有Tbl_SensorDataSetTableadapter的数据集


使用
ReportEmbeddedResource
而不是
ReportPath
,因为
ReportPath
查找文件存在,而
ReportEmbeddedResource
将程序集资源作为完全限定的对象名查找

以下是示例:

report.ReportEmbeddedResource = full Namespace.report.rdlc

这是.\u reportViewer.LocalReport.ReportEmbeddedResource=“IntelliOpticsReport.MainWindow.SensorReport.rdlc”;我使用它,但不获取rdlc文件是的,它应该可以工作,否则您可以做的是标记您的报表副本本地(如果较新的内部版本操作),然后您可以在您的命名空间中使用report.reportpath.Main的reportpath属性上面的命名空间是窗口或命名空间报表文件需要命名空间,而不是报表对象
                        Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1;
                        Tbl_SensorDataSet dataset;
                        string query = Reportingquery;
                        dataset = new Tbl_SensorDataSet();
                        reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
                        Tbl_SensorDataSetTableAdapters.GetFilterReadingTableAdapter TableAdapter1 = new Tbl_SensorDataSetTableAdapters.GetFilterReadingTableAdapter();
                        TableAdapter1.ClearBeforeFill = true;
                        TableAdapter1.Fill(dataset.GetFilterReading, query);
                        dataset.BeginInit();
                        reportDataSource1.Name = "DataSet1";
                        reportDataSource1.Value = dataset.GetFilterReading;
                        this._reportViewer.LocalReport.DataSources.Add(reportDataSource1);                            
                        this._reportViewer.LocalReport.ReportPath = "../../SensorReport.rdlc";
                        dataset.EndInit();
                        _reportViewer.RefreshReport();
                        _isReportViewerLoaded = true;
                    }
                }

        catch (Exception ex) { throw ex; }            
    }
report.ReportEmbeddedResource = full Namespace.report.rdlc