【发布时间】:2021-01-07 03:02:10
【问题描述】:
在从我们的 SSRS 呈现 pdf 报告时,我遇到了一个问题,请参见下文。我试图研究不同的来源,但到目前为止没有任何效果。
Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.MissingEndpointException: 'The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.'
我有这行代码应该可以工作:
var parameters = new List<ReportParameter>
{
new ReportParameter("paramter_1", "paramter_1_value"),
};
var reportServerUrl = ConfigurationManager.AppSettings["ReportServerUrl"];
reportViewer.ServerReport.ReportServerUrl = new Uri(reportServerUrl);
reportViewer.ServerReport.ReportPath = '/ReportFolder/ReportName';
reportViewer.ServerReport.ReportServerCredentials = new CustomCredentials();
reportViewer.ServerReport.SetParameters(parameters);
reportViewer.ServerReport.Refresh();
var mimeType = "";
var encoding = "";
var filenameExtension = "pdf";
string[] streamids = null;
Warning[] warnings = null;
var outputFileName = "File_Name.pdf";
var bytes = reportViewer.ServerReport.Render("PDF", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings);
var pdfReport = File(bytes, "application/pdf", outputFileName);
我在这里做错了吗?
【问题讨论】:
标签: c# asp.net-mvc reporting-services ssrs-2012