简体   繁体   English

SSRS - 渲染为 PDF 并重新上传

[英]SSRS - Rendering to PDF and reupload

is it possible to render/save a SSRS report as a PDF and upload the PDF-file on the server in a second step?是否可以将 SSRS 报告呈现/保存为 PDF 并在第二步中将 PDF 文件上传到服务器上? I would prefer Powershell webservices?我更喜欢 Powershell 网络服务?

Thank you in advance.先感谢您。

You are not showing your code, or what you've even searched for.您没有显示您的代码,或者您甚至没有搜索过的内容。 Folks here don't like it when you don't show any effort, and will quickly downvote your post or vote to close and point you here: https://stackoverflow.com/help/how-to-ask .当您不表现出任何努力时,这里的人们不喜欢它,并且会迅速否决您的帖子或投票关闭并将您指向此处: https : //stackoverflow.com/help/how-to-ask Closing by telling you that StackOverflow is not a free script writing service.最后告诉您 StackOverflow 不是免费的脚本编写服务。

However, since you are very new here, I'll provide you this, this time.但是,由于您是新来的,这次我将提供给您。

I am not sure what this is... 'Powershell webservices', but maybe you meant PowerShell Web Access , and if so, that is not what it is for.我不确定这是什么......'Powershell webservices',但也许你的意思是PowerShell Web Access ,如果是这样,那不是它的用途。 Saving output to PDF using PowerShell is a real common thing, and well documented all over the web and that just requires a simple search for that content/samples:使用 PowerShell 将输出保存为 PDF 是一件非常普遍的事情,并且在整个网络上都有很好的记录,只需要简单地搜索该内容/示例:

See the PowerShell cmdlet查看 PowerShell cmdlet

Out-Printer 外印机

Just choose a PDF printer installed on the target.只需选择安装在目标上的 PDF 打印机。

Sending PowerShell Results to PDF (Part 1 - 3)将 PowerShell 结果发送到 PDF(第 1 - 3 部分)

https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/sending-powershell-results-to-pdf-part-1 https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/sending-powershell-results-to-pdf-part-1

https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/sending-powershell-results-to-pdf-part-2 https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/sending-powershell-results-to-pdf-part-2

https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/sending-powershell-results-to-pdf-part-3 https://community.idera.com/database-tools/powershell/powertips/b/tips/posts/sending-powershell-results-to-pdf-part-3

The author provides samples in each post listed...作者在列出的每个帖子中都提供了示例...

Snippet from part 3:第 3 部分的片段:

function Out-PDFFile
{
    param
    (
        $Path = "$env:temp\results.pdf",

        [Switch]
        $Open
    )

...
}

Creating PDF files using PowerShell 使用 PowerShell 创建 PDF 文件

Sometimes, you may want your scripts to produce output for management in a format other than plain text or Excel files (CSV).有时,您可能希望脚本以纯文本或 Excel 文件 (CSV) 以外的格式生成用于管理的输出。 Thanks to various .NET PDF creation libraries, it is relatively simple to create PDF reports using PowerShell.得益于各种 .NET PDF 创建库,使用 PowerShell 创建 PDF 报告相对简单。

Directly from Microsoft Docs site.直接来自 Microsoft Docs 站点。

Automate SSRS Report Generation using PowerShell 使用 PowerShell 自动生成 SSRS 报告

This blog post is tested on SQL Server 2014 and PowerShell V5.这篇博文在 SQL Server 2014 和 PowerShell V5 上进行了测试。

... ...

In this blog post I will focus on generating PDF reports via scripting.在这篇博文中,我将重点介绍通过脚本生成 PDF 报告。 Let's tackle this piece by piece first, and we'll put everything in a nice little script at the end of the post.让我们先一点一点地解决这个问题,我们将把所有内容放在帖子末尾的一个漂亮的小脚本中。 ... ...

As far as uploading files, that is what the PowerShell web cmdlets are for.至于上传文件,这就是 PowerShell web cmdlet 的用途。

Invoke-WebRequest 调用 WebRequest

Invoke-RestMethod 调用-RestMethod

or the native .Net namespace或本机 .Net 命名空间

WebClient.UploadFile Method WebClient.UploadFile 方法

... so as for this... 'Powershell webservices', I am going to assume this is what you meant. ......至于这个......'Powershell webservices',我假设这就是你的意思。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM