I have a simple report that displays department number and department name with interactive sorting enabled on those two column headers in the tablix.
I am access this report via URL access from an MVC5 application. The report is being rendered in standard html4.0 correctly. I can see the report html in my page with the sort icons in the headers as expected. However, clicking on either column header and i receive an error page from SSRS of rsReportNotReady.
If I browse directly to the report via URL access by itself, interactive sorting works just fine but not when streamed into an mvc view as raw html.
code to render the report as html via url access:
private string GetReportData(string requestUri)
{
string reportData = string.Empty;
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUri);
request.Credentials = CredentialCache.DefaultNetworkCredentials;
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
Stream receiveStream = response.GetResponseStream();
if (receiveStream != null)
{
StreamReader readStream = response.CharacterSet == null
? new StreamReader(receiveStream)
: new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));
reportData = readStream.ReadToEnd();
response.Close();
readStream.Close();
}
}
return reportData;
}
example URL to access report http://myreportservername/ReportServer?/EmployeeReports/rptDepartments&rc:Toolbar=False&rc:HTMLFragment=False&rs:Format=HTML4.0
error from sorting via mvc app
Does anyone have any insight into making interactive sorting of an SSRS report work in an MVC application via URL access? No, I cannot use the ReportViewer control either.
Thanks in advance.
I no longer need this resolved. What we were trying to do is not the best way, or easily possible. Ultimately, we switched to using amcharts from https://www.amcharts.com/ to build the charts on the fly with full interactivity.