本文介绍了出于安全原因,禁止使用dtd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在sql server2005商业智能开发工作室(SSRS PROJECT)上做了一个报告,并在IPAddress(190.168.327.183/ReportFolder)上进行了部署。

我从那个ip发出了一个电话报告关于ReportViewer的报告。



首先我打电话给



I have made a report on sql server2005 business intelligence development studio(SSRS PROJECT) and deploy at an IPAddress(190.168.327.183/ReportFolder).
And I make a call report from that ip and vender the report on ReportViewer.

First I call

  public void GetConnectionOfReportServer()
        {
            try
            {
               NetworkCredential credential = new NetworkCredential("administrator", "pass", "RSERVER");
this.reportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials = credential;
                this.reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
            this.reportViewer1.ServerReport.ReportServerUrl = new Uri(@"http://190.168.327.183/ReportFolder");




            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
            }

        }



然后拨打


and then call

 public void getReportFrmServer(string report, string[] param)
        {
            try
            {
this.reportViewer1.ServerReport.ReportPath = "/ReportFolder/" + report;
                this.reportViewer1.ServerReport.Timeout = 3600000;
                if (report == "Report1")
                {
                    ReportParameter[] parameter = new ReportParameter[1];
                    parameter[0] = new ReportParameter("startDate", param[0]);

                    this.reportViewer1.ServerReport.SetParameters(parameter);
                    this.reportViewer1.RefreshReport();
                }
}
catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
}



在某些电脑上工作但是一台电脑有问题

出于安全考虑,DTD在此XML文档中禁止。要启用DTD处理,请将XmlReaderSettings上的ProhibitDtd属性设置为false,并将设置传递给XmlReader.Create方法。


At some pc it is working but one pc there is problem
"For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method."

推荐答案

"For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method."





所以要么在应用程序中执行此操作处理它时,或者在创建文档时不生成文档类型声明:



So either do that in the app that processes it, or don't generate document type declarations in your documents when you create them:

XmlReaderSettings xrs= new XmlReaderSettings();
xrs.ProhibitDtd = false;

并将其传递给您的Create方法。

And pass that to your Create method.


这篇关于出于安全原因,禁止使用dtd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 18:36