运行 ssrs 报告并通过 .net 代码通过电子邮件发送
我有一份报告,显示每天运行的进程中的所有错误(如果有)。
在该过程结束时,我想编写一些代码来执行报告并通过电子邮件发送。我正在了解如何通过代码通过电子邮件发送报告,但我似乎找不到任何显示如何通过代码运行报告的地方。
我在 vs 08 中使用 C#,报告来自 ssrs 08。任何帮助将不胜感激!
I have a report that shows all errors (if there are any) from a process that runs every day.
At the end of the process, I want to write some code to execute the report and email it. I am seeing how to email a report from code, but I can't seem to find anywhere that shows how to run the report from code.
I am using C# in vs 08, and the report is from ssrs 08. Any assistance would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
下面是一些将报告渲染为字节的 vb 代码:
这显示了在代码中渲染报告的基本内容。 VS 2005 代码。
Here is some vb code to render the report into bytes:
this shows the basic stuff for rendering a report in code. VS 2005 code.
如果您不使用 ReportViewer,请调用 报告服务网络服务器(不是报告管理器),然后通过电子邮件发送。
if you aren't using ReportViewer, then call the Reporting Service web server (not report manager), and then email it.
我最终创建了一个新的订阅来创建一个作业的报告。
我通过执行作业的代码运行该作业(取自 Microsoft),
如下所示:
通过调用作业(这是一个订阅),报告被呈现并通过电子邮件发送给订阅收件人。
I ended up creating a new subscription to the report which creates a job.
I ran the job from code that executes the job(Taken from Microsoft)
Like this:
By calling the job- which is a subscription - the report was rendered and emailed to the subscription recipients.