I'm trying to determine how difficult it is to automate a process using Powershell. Using Report Builder, I created a simple report with a single parameter, the ID number of the list I use as a datasource. I can open the report, enter the ID and I get the report. Is it possible to use Powershell to run the same report, pass in the ID, export the report as a PDF and save it in the Shared Documents library in the same site?
1 Answer
Maybe something like this? Essentially what this guy is doing is using the WinForms Report Builder dll to pull in the SSRS report and export it using code.
You can upload the file once you have it through code that looks similar to this (referenced from Todd Klindt):
$Web = Get-SPWeb $WebURL
$List = $Web.GetFolder($DocLibName)
$Files = $List.Files
$Files.Add($DocLibName +"/" + $FileName,$PDFExportedFile.OpenRead(),$false)
-
I actually found that same article and was able to partially get my result. I was hoping to do it all within SharePoint, but this allowed me to actually generate the PDF to a file on my hard drive. I could go this route if I could then add that physical file to a designated SP library using Powershell. Commented Apr 25, 2016 at 18:37
-
-
alternatively, you can download the report by using powershell to access the report via url msdn.microsoft.com/en-us/library/ms154040.aspx– ShawnCommented Apr 27, 2016 at 1:32