Hello SSRS Profis!
I'm having the following Problem:
I was trying to integrate SSRS in my Company-Software, and until today it went quite good:
Its an ASPMVC 5 project with WCF-Services, and in these i had methods to render reports with the help of the ReportExecution - Webservice (2005), the Version of the MSSQL Server we use is 2008R2, reports use stored procedures as data sets.
Everything worked fine, i could render all my reports in the services, gave the result back to the Frontendprojects to present it there, it worked fast and properly.
Until today: For some reason, the call of the ReportExection.Render() - Method gives no more results back.
Debugging shows me that it works approx. the same time as it did before for every report, but the result now is only "null" for every report i integrated until now:
Here is the code I use to execute the service (for network credentials i use a user with administrator privilegue who can access all the reports (tested in private session), Parameter constructio also should work properly because it did before, same for the Report path...
Any Ideas would be helpful!
private byte[] getPDFFromReport(string ReportPath, Dictionary<string, string> parameterDicitionary) { ReportExecutionService rs = new ReportExecutionService(); // private method to set a user with enough permissions rs.Credentials = SetServiceAccount();
// Render arguments byte[] result = null; string reportPath = ReportPath; string format = "PDF"; string historyID = null; string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"; // Prepare report parameter.
// mapping Parameters, gives back ReportExecution.ParamaterValue Array, still works as it should ParameterValue[] parameters = SetReportParameters(reportPath, parameterDicitionary);
DataSourceCredentials[] credentials = null; string showHideToggle = null; string encoding; string mimeType; string extension; Warning[] warnings = null; ParameterValue[] reportHistoryParameters = null; string[] streamIDs = null; ExecutionInfo execInfo = new ExecutionInfo(); ExecutionHeader execHeader = new ExecutionHeader(); rs.ExecutionHeaderValue = execHeader; execInfo = rs.LoadReport(reportPath, historyID); rs.SetExecutionParameters(parameters, "de-de"); // rs.Timeout = 300000; String SessionId = rs.ExecutionHeaderValue.ExecutionID; Console.WriteLine("SessionID: {0}", rs.ExecutionHeaderValue.ExecutionID); try { result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs); execInfo = rs.GetExecutionInfo(); Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime); } catch (SoapException e) { Console.WriteLine(e.Detail.OuterXml); } // Write the contents of the report to an MHTML file. return result; }
Edit:
I tested the methods with the same user in an WindowsForms Project and got a result. In a former Version, it also still works. I changed nothing since the last deploy in this methods, so can't imagine why it suddenly stopped working....