.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

PowerShell results as a sorce for a report

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :Sql Server

I know that PowerShell scripts can be executed from inside SQL but; how would you use the results as the datasource for an SSRS Report.

I find articles using PowerShell to render an SSRS Report, but I am looking from the other direction. 


D Graham

View Complete Post

More Related Resource Links

Share The Load: Report Visual Studio Team System Load Test Results Via A Configurable Web Site


This article discusses a new load test tool in Visual Studio 2005 Team System for performance and stress testing your Web sites, Web services, and other server components. Combined with its handy reporting capabilities, the load test tool provides some powerful options for sharing and managing test results.

Wen Ding

MSDN Magazine June 2006

SSRS 2005 Matrix results affected by defaulting being set on report parameter?


We discovered some very odd matrix behavior a couple days ago and just today found out what in the RDL seems to be causing the issue.  The issue is that certain cells in the matrix will not be populated if a certain report parameter is defaulted.

The basics:  A matrix report with 6 report parms two of which are passed to the underlying procedure call.  There are 6 datasets behind the report.  4 are related to getting date and timespan information to allow for parameter defaulting.  1 gets a list of customers to populate a selection drop down and the last gets the data.

The data query takes a customer name and an end date.   Via the report parameters the end date parm is defaulted based on a dataset which is chained through the other parms and associated datasets.

The matrix is used to show a months worth of activity by day.  There are two int32 data points in each matrix cell one is a total and one is a failure count.  The data as returned by the reporting proc is already summarized so no aggregate is needed in the matrix.  However, using SUM or not in the matrix cell makes no difference to the strange outcome.

When the report is run with the end date parameter being defaulted one of the rows will incorrectly show 16 cells.  The cells appear as if there is no data.  However, if the proc

Alternating row background for first column of a report


is there a way to make the first column of a report use the an alternating background color? 

I have the background color set for the entire row however it does not work for the first column if the color is set to an expression.  If I just set it to a color i.e. red it works just fine. If I insert a dummy column to the left it works just fine (but the dummy column does not work, presumably because it is first??).

In the file below only the textbox for part number does not show an alternating background.  All others work correctly.

                    <Textbox Name="PartNumber">

Need Syntax To Make Results of LINQ Union Return Non-Generic Type



I have the below SQL which works just fine:

SELECT     Message, CreateDate, AccountId, AlertTypeId
FROM       dbo.Alerts
SELECT     TOP (100) PERCENT Status, CreateDate, AccountId,
                          (SELECT     10 AS Expr1) AS AlertTypeId
FROM         dbo.StatusUpdates
WHERE AccountId = PassedInParameter

I have been going about trying to convert the above into a LINQ method and am having problems with return types.
As the above SQL illustrates, I am querying two distinct LINQ tables - Alerts and StatusUpdates -
and then attempting to perform a Union on them. In order to do the union in LINQ, I have to have agreeing types. So, I
am using "var" to make the results of "alerts" and "updates" generic before the union.  

public IList GetStatusUpdatesAsAlertsByAccountId<T>(Int32 accountId)
            using (WorkbookDataContext dc = _conn.GetCont

sqlDataReader dos not get results


I am trying to run a stored proc from this function. When I run it thorugh the debugger I can see that myReader.HasRows = true and myReader.FieldCount =14.

But the control does not go in the loop while (myReader.Read()) where I am trying to read Version field returned by the stored proc.

Pls check me code and suggest correction. Thank You.

private static int Get_CaseInfo(string CaseNum)
            int Ver = 0;
            String myConn = ConfigurationManager.ConnectionStrings["DBConnectionString"].ToString();
            SqlConnection conn = new SqlConnection(myConn);
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = System.Data.CommandType.Text;

            SqlDataReader myReader = null;
            String stmt1 = "EXEC [REPORTS].[CaseInfoByCaseNo_Get] @CaseNo = '" + CaseNum + "'"; 
            cmd.CommandText = stmt1;
            cmd.Connection = conn;
                myReader = cmd.ExecuteReader();
                while (myReader.Read())
                    Ver = (int)myReader["Version"];

            catch (Exception)
            return Ver;         

displaying xsl results in browser


Hi guys,

How can I test what my xsl spits out in the browser, rather than just viewing the xsl itself?


How to use report viewer 2010 in VS 2008


I downloaded report viewer 2010 from here


Now I want to actually use it in a website.  How do I do that?  Do I have to modify some part of web.config?  Specifically, what do I need to change?


populate report viewer by code


Hi all

I have a button "Show Report" to show some data from table

what I should write under this button to populate the reports ?

A connection could not be made to the report server http://localhost/ReportServer.



  • I created a Report using Business Intelligence Studio. Its working working well, i can able to view records. But when i try to deploy the report an error occurs specifying that "A connection could not be made to the report server http://localhost/ReportServer. (Microsoft Report Designer)".
  • I open the IIS 7 and find out virtual directories "Reports" and "ReportServer" are available.
  • I check on the browser and type "http://localhost/reports".  I find the browser direct to this url: http://localhost/reports/Pages/Folder.aspx and find error specifying the following one:

         Error:The report server is not responding. Verify that the report server is running and can be accessed from this computer.

  • when i type http://localhost/reportmanager, i found the error:

    HTTP Error 404.0 - Not Found

    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.


Stop Sorting Cross Tab Report Header


Dear, I want to stop sorting in cross tab report header. And also want to sort in specific order. How can i do that? Please help me. Its urgent


May i use the collapse and expand feature (like tree menu) in Report ?


HI all,

May i use the collapse and expand feature (like tree menu) at Report iam using the Report viewer  Control for displaying the Report on my Asp.net Page .


I have number records and each record have detail as i clicked or expand the record then details will be shown is it possible with report viewer control 
If any one have experince before please share the ideas.


Best Regards

Cannot Display Image in Report


 I have a report using an image control that needs to display an image inside subfolder "Images\InstitutionLogos\".

On properties of image control i have the following properties set:

MIMEType= "image/png"

Source      = Database

Value        ="\Images\InstitutionLogos\" +Fields!InstitutionID.Value+".png"

Inside subfolder "Images\InstitutionLogos\" each image is named with a number which represents Fields!InstitutionID.,(ex, 1.png, 2.png, 10.png)

However, when i run the report the image just displays an X, what am i missing?

Dynamic Report in reportviewer


HI I m sorry to say this But this task too urgent.

 Ex- i have two tables in my db name called Comdetails, deptdetails.

TCS is a one company name stored in ComDetails and Company_ID took as primany key,

TCS having 10 department stored in deptdetails and Company_ID as foreign key.

so now in DB we have available one company with 10 departments.

so now i need to generate report , i m using report.rdlc and reportviewer.

i hope upto now its clear.

my task-

1- i have two pages in a report in page 1 i m doing designing report like top i  need to show companydetails, middle frist department details in deptdetails table , and bottom some calculation part leave about calculation part. in report page 2 on  top i need to show second department details from deptdetails next below the design again same design i did here i need to show 3 department details from deptdetails next below the design again same design i did here i need to show 4 department details from deptdetails next below again calculation part design leave about calculation part. so up to now i shown 4 department details here still i need to show 6 department details , for this programatically after 4 department details finish next generate dynamatically page 2 of re

Reporting services in 2008 r2 how to get a report in a print button click event in my c#.net page


how to  get a report in my c#.net page button lick event also steps to call a report from asp.net to reporting services


Thanks in advance

Report viewer error


  • An error has occurred during report processing.
    • A data source instance has not been supplied for the data source "PatientDetailsReport_DataTable1".

  • i am using two to three rdlc reports in my page for single report viewer when i first load the page i got the output in reportviewer but when i try to load other rdlc report then am getting the above mentioned error.i cleared all the datasources for the report viewer before giving new datasource but am getting the same error pls someone help

Printing crystal report from webservice



I am trying to print crystal repot directly from a C# application, which is calling webservice. I am able to display report in crystalreportviewer by passing the webservice call to datasource. However, is there anyway, I can print directly without showing the report?

Alternatively, I was trying return ReportDocument object from webservice, which would solve my problem, but I was unable to return the ReportDocument because of serialization issue. Is it even possible? Thank you


Load Report Failed


Hi All,

I created a simple crystal report using visual studio 2008 (GAC INSTALLED VERSION 10.5.3700.0) . It is working fine locally. When I deploy it to the server when I click on the report I am seeing the empty report with  "LOAD REPORT FAILED" Text. How can I resolve this Issue?

I checked the GAC and made sure that Both are using the same version of Crystal reports . Can some one help me how to resolve this issue?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend