Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从网络文件夹工作组环境加载Rdlc报告_C#_Rdlc - Fatal编程技术网

C# 从网络文件夹工作组环境加载Rdlc报告

C# 从网络文件夹工作组环境加载Rdlc报告,c#,rdlc,C#,Rdlc,我有一个带有报表查看器的Windows窗体。我创建了一个rdlc报告,该报告使用类型化数据集作为数据源。该报告是在VS2013中创建的,在设计和测试阶段,初始位置位于应用程序文件夹中。现在我需要将应用程序部署到用户,并希望将该文件夹放在对所有工作组用户开放的网络共享文件夹中 我像这样编写代码,当报表源位于应用程序文件夹中,并且源代码添加到设计器中时,它可以完美地工作 private void Form1_Load(object sender, EventArgs e) {

我有一个带有报表查看器的Windows窗体。我创建了一个rdlc报告,该报告使用类型化数据集作为数据源。该报告是在VS2013中创建的,在设计和测试阶段,初始位置位于应用程序文件夹中。现在我需要将应用程序部署到用户,并希望将该文件夹放在对所有工作组用户开放的网络共享文件夹中

我像这样编写代码,当报表源位于应用程序文件夹中,并且源代码添加到设计器中时,它可以完美地工作

 private void Form1_Load(object sender, EventArgs e)
        {
            Shipitdata dta = new Shipitdata();
            ShipitdataTableAdapters.LinePlanTableAdapter adapt = new LinePlanTableAdapter();
            DataTable dt = adapt.GetData();
            ReportDataSource datasource = new ReportDataSource("Shipitdata", dt);
            this.reportViewer1.LocalReport.DataSources.Clear();
            this.reportViewer1.LocalReport.DataSources.Add(datasource);
            this.reportViewer1.RefreshReport();
            this.reportViewer1.RefreshReport();
          //  loadreport();
        }
现在我需要从共享文件夹加载报告,所以我编写代码如下

private void Form1_Load(object sender, EventArgs e)
        {
            Shipitdata dta = new Shipitdata();
            ShipitdataTableAdapters.LinePlanTableAdapter adapt = new LinePlanTableAdapter();
            DataTable dt = adapt.GetData();
            ReportDataSource datasource = new ReportDataSource("Shipitdata", dt);
            this.reportViewer1.LocalReport.DataSources.Clear();
            this.reportViewer1.LocalReport.DataSources.Add(datasource);

             reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;

            reportViewer1.ServerReport.ReportPath = @"\\sreenath-it\HRMSERVER\Reports_ATCHRM\Report1.rdlc";
            NetworkCredential cred = new NetworkCredential("sreenath", "******", "atraco");
            reportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials  = cred;

            reportViewer1.RefreshReport();
        }

但是当表单加载时,我在报告中没有得到任何数据。报表查看器是空白的,没有任何数据。是否有人知道如何将报表嵌入应用程序程序集中?以及如何部署应用程序?是通过单击一次完成的吗?this.reportViewer1.LocalReport.ReportEmbeddedResource=“@”\\srenath it\HRMSERVER\Reports\u ATCHRM\Report1.rdlc”;以前我只是给出调试项目后得到的exe。但现在我想到了单击一次