问题描述
我有兴趣在我的 vue.js .net 核心项目中使用报告服务.我不需要 reportviewer 控件,只是为了执行适当的代码来远程处理它以作为字节流返回到 .pdf 中.
我有我以前在 ASP.net MVC/angularjs 项目中与 microsoft.reporting.webforms 命名空间一起使用的代码来做同样的事情,但 webforms 实现将不再与 .net 核心管道一起使用.
I'm interested in using reporting services in my vue.js .net core project. I don't need the reportviewer control, just to execute the appropriate code to process it remotely to return as a bytestream into a .pdf.
I have my previous code I used with the microsoft.reporting.webforms namespace in an ASP.net MVC / angularjs project to do the same thing, but the webforms implementation will no longer work with the .net core pipeline.
有谁知道如何使用 .net core 1.1 远程调用 SSRS 报告?在 .net 4.x 中,这是通过 ReportViewer.ServerReport.Render("PDF", etc...) 完成的
Does anyone know how to call an SSRS report remotely using .net core 1.1? In .net 4.x this was done via ReportViewer.ServerReport.Render("PDF", etc...)
谢谢.
推荐答案
SSRS 提供了一个 报告执行网络服务,它允许开发人员完全按照您的要求执行操作.事实上,您之前使用的 ReportViewer 控件很可能在幕后使用此 Web 服务.这意味着仍然可以远程呈现报表,但这次不是通过报表查看器控件(不适用于 .NET Core)来完成,而是通过直接访问 Web 服务来完成.
SSRS offers a report execution web service that allows developers to do exactly what you're trying to do. In fact, the ReportViewer control that you were previously using is most likely using this web service behind the scenes. This means that it is still possible to render a report remotely, but this time instead of doing it through the report viewer control (which does not work with .NET Core), you will do it by accessing the web service directly.
您需要查看有关此 web 的文档在这里服务.具体来说,您需要查看 Render和 Render2 方法将呈现报告并返回它以 byte[]
的形式返回给您.
You will want to take a look at the documentation regarding this web service here. Specifically, you will want to look at the Render and Render2 methods which will render the report and return it back to you in a byte[]
.
这篇关于如何在 .net core 中使用微软报告服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!