BGabriel
BGabriel

Reputation: 51

SSRS 2005 report execution service returns no results

I have a report that when run normally it returns the correct data, but when I run via the report execution service the report does not contain any data. We do pass in a parameter that contains the ID that we filter on, using a label on the report we can validate that it is getting sent.

If I look at the ExecutionLogStorage table I can see my report ran with a Status of rsSuccess but the RowCount is 0. There are no errors in the event log or report server logs.

Below is the method that we use to report the report to PDF:

    public byte[] Render( ReportRequest rptRequest )
    {
        ReportExecutionService rs = new ReportExecutionService();

        rs.Credentials = CredentialCache.DefaultCredentials;
        rs.Url = rptRequest.ReportExecutionServerEndPoint;

        string reportPath = string.Format(
            "/{0}/{1}",
            rptRequest.ReportDataBaseName,
            rptRequest.ReportName );

        string format = "PDF";

        string historyID = null;
        string devInfo =
            @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";

        string encoding;
        string mimeType;
        string extension;
        Warning[] warnings;
        string[] streamIDs;

        ExecutionHeader execHeader = new ExecutionHeader();

        rs.ExecutionHeaderValue = execHeader;
        rs.LoadReport( reportPath, historyID );

        rs.SetExecutionParameters( rptRequest.ReportParameters, "en-us" );

        return rs.Render(
            format,
            devInfo,
            out extension,
            out encoding,
            out mimeType,
            out warnings,
            out streamIDs );
    }

Upvotes: 0

Views: 977

Answers (1)

BGabriel
BGabriel

Reputation: 51

Turns out that the code was running under a different user account when it was deployed. That account did not have permissions to read any of the data.

Upvotes: 1

Related Questions