Dear all,
We have a WPF application which is able to preview reporting services report by implementing the Microsoft.Reporting.Winforms control.
When we were using Reporting Service 2008 all was working fine and now moving to rss2014 we get trouble to retrive correct information from report page. The report control pageCount return all time a single page count info while there are more pages in report.
If report is preview directly from Internet Expolorer, page count is correct but not by retriving it from ReportViewer control
The way we are getting page count is simply by calling the following method of the control :
We are redering the report preview as a Bitmap, so each page inside the report are render as PNG file using stream ID as seen in MSDN sample.
The code below is the render method we use to build different pages as bitmap for preview:
/// <summary> /// Renders the report. /// </summary> /// <param name="format">The format into which to render the report.</param> /// <param name="deviceInfo">The xml data that specifies the rendering parameters.</param> /// <param name="streams">Returns the different streams rendered.</param> private void Render(string format, string deviceInfo, Queue<Stream> streams) { string mimeType = null; string encoding = null; string fileNameExtension = null; string[] streamIds = null; Warning[] warnings = null; byte[] data = null; // Render & get the first stream data = _report.Render(format, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streamIds, out warnings); streams.Enqueue(new MemoryStream(data)); // Sort the stream ids in the order of the report pages. Array.Sort<string>(streamIds, new Comparison<string>(RenderStreamIdComparer)); // Retreive the following pages foreach (string streamId in streamIds) { data = _report.RenderStream(format, streamId, deviceInfo, out mimeType, out encoding); streams.Enqueue(new MemoryStream(data)); } }
The methode _report.Render is part of the MS assembly report class. Each stream Id return is suppose to represent each report page, but at this level it returns only one single streamID even if my report has more than 1 page.
This was working ok so far until the time we update to RSS2014.
Any idea why those page count is not returning correctly ?
regards