Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - reporting services and powershell results

Reply
 
Old 10-10-2007   #1 (permalink)
Thuan


 
 

reporting services and powershell results

I'm looking for ideas on how best to consume Powershell result sets from
Reporting Services 2005.

One method I was trying was a combination of powershell, and XML output. I
found an XML function (see function below) on a blog, which I've modified to
output an XML string that RS can read as an embedded XML datasource. I
create an XML datasource in Reporting Services, and embed the XML string as a
hardcoded query. (see step 9 from:
http://msdn2.microsoft.com/en-us/library/aa337458.aspx) Works great, but
it's still static.

I haven't figured out how to send dynamic results. I've tried experimenting
with custom code in Reporting Services, but it's starting to involve a lot
more "massaging" before I can get a viable dataset that Reporting Services
can recognize.

I'm hoping the newsgroup can drop some ideas whether there's a more
efficient way of leverage Reporting Services against powershell.

Powershell Reporting Services XML export function (I apologize to the
author...I forget where):

# ========================================
function New-RSEmbeddedXml($ChildItems="*")
{
Begin {
$xml = "<Query><XmlData><Root>"
}

Process {
$xml += "<ITEM>"
foreach ($child in $_ | Get-Member -Type *Property $childItems){
$Name = $child.Name
$xml += " <$Name>$($_.$Name)</$Name>"
}
$xml += "</ITEM>"
}

End {
$xml += "</Root></XmlData></Query>"
$xml
}
}
# ========================================


My System SpecsSystem Spec
Old 10-13-2007   #2 (permalink)
Marco Shaw [MVP]


 
 

Re: reporting services and powershell results

Thuan wrote:
Quote:

> I'm looking for ideas on how best to consume Powershell result sets from
> Reporting Services 2005.
Reporting Services isn't available with SQL Express, so I need to go out
and get a VM setup. I tried to get a SQL 2005 VHD on Friday, but seemed
to have authentication problems with my Live account.

It will be Sunday night before I can get back to restarting the
download, and depending how big it is, it could be Monday before I have
it running (and even longer if the VHD image doesn't have Reporting
Services installed by default).

Still need help and can you wait?



--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 10-13-2007   #3 (permalink)
Flowering Weeds


 
 

Re: reporting services and powershell results


"Marco Shaw [MVP]"
Quote:

>
> Reporting Services isn't available with SQL Express,
Live Search: "Reporting Services 2005" +express
http://search.msn.com/results.aspx?q...%22+%2Bexpress

Reporting Services in SQL Server 2005 Express Edition with Advanced
Services
http://msdn2.microsoft.com/en-us/library/ms365166.aspx




My System SpecsSystem Spec
Old 10-13-2007   #4 (permalink)
Oisin Grehan


 
 

Re: reporting services and powershell results

On Oct 13, 1:26 pm, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com>
wrote:
Quote:

> Thuan wrote:
Quote:

> > I'm looking for ideas on how best to consume Powershell result sets from
> > Reporting Services 2005.
>
> Reporting Services isn't available with SQL Express, so I need to go out
> and get a VM setup. I tried to get a SQL 2005 VHD on Friday, but seemed
> to have authentication problems with my Live account.
>
> It will be Sunday night before I can get back to restarting the
> download, and depending how big it is, it could be Monday before I have
> it running (and even longer if the VHD image doesn't have Reporting
> Services installed by default).
>
> Still need help and can you wait?
>
> --
> Microsoft MVP - Windows PowerShellhttp://www.microsoft.com/mvp
>
> PowerGadgets MVPhttp://www.powergadgets.com/mvp
>
> Blog:http://marcoshaw.blogspot.com
SQLExpress/Advanced Services is free, and includes Reporting Services.

- Oisin

My System SpecsSystem Spec
Old 10-19-2007   #5 (permalink)
Thuan


 
 

Re: reporting services and powershell results

Right now, I have a clunky solution involving running a powershell script,
and exporting its results to a tempoary CSV file. I then import that file
into SQL server via a BULK IMPORT statement into a temporary SQL table from a
stored procedure. The same stored procedure ends by doing a SELECT on that
temp table. From Reporting Services, call that sproc and consume the data
like any other sproc.

This would've worked out ok, but I plan to report on some data that include
comma's...so exporting it to a CSV file doesn't leave a clean dataset.
Another option is to export directly to a real SQL table (instead of the temp
table), but I'm trying to avoid needing to create more objects that are
required. In this case, this method would only need the powershell script,
the sproc, and the report.

Hope someone comes up with more elegent solution.

Thanks!


"Marco Shaw [MVP]" wrote:
Quote:

> Thuan wrote:
Quote:

> > I'm looking for ideas on how best to consume Powershell result sets from
> > Reporting Services 2005.
>
> Reporting Services isn't available with SQL Express, so I need to go out
> and get a VM setup. I tried to get a SQL 2005 VHD on Friday, but seemed
> to have authentication problems with my Live account.
>
> It will be Sunday night before I can get back to restarting the
> download, and depending how big it is, it could be Monday before I have
> it running (and even longer if the VHD image doesn't have Reporting
> Services installed by default).
>
> Still need help and can you wait?
>
>
>
> --
> Microsoft MVP - Windows PowerShell
> http://www.microsoft.com/mvp
>
> PowerGadgets MVP
> http://www.powergadgets.com/mvp
>
> Blog:
> http://marcoshaw.blogspot.com
>
My System SpecsSystem Spec
Old 10-21-2007   #6 (permalink)
Marco Shaw [MVP]


 
 

Re: reporting services and powershell results

> Hope someone comes up with more elegent solution.

I saw this today:
http://www.paulstovell.net/blog/inde...es-automation/

I don't know if this help.

Honestly, I don't know Reporting Services at all. I mentioned I would
look into this earlier this week, but just haven't found the time.

Marco
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Reporting Services - Report Viewer webpart -- for MOSS on Vista Vista General
Use PowerShell to trigger SCOM reporting? PowerShell
Sql Reporting Services - displaying link .NET General
Reporting Services Report Model .NET General
Different results from WMI in Powershell and VBS PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46