"<DeviceInfo><OutputFormat>emf</OutputFormat><StartPage>1</StartPage></DeviceInfo>";
byte[] bytes = rvwMain.ServerReport.Render(
"emf", deviceInfo, out mimeType, out encoding, out extension,
out streamids, out warnings);
long PageCount = streamids.Length;
long TotPages = rvwMain.ServerReport.GetTotalPages();
long l_lngStmTotPages = streamids.Length;
TimeSpan l_tsDuration = DateTime.Now.Subtract(l_dtmStartDateTime);
string l_strDuration = l_tsDuration.TotalMilliseconds.ToString();
I get NO error If I use any of the following Extensions
But when I try to render it using EMF I start getting following Error.
ERROR MESSAGE
System.Exception: ReportViewer.LoadReport::Microsoft.Reporting.WebForms.ReportServerException: An attempt has been made to use a rendering extension that is not registered for this report server. (rsRenderingExtensionNotFound)
I am using web application to run this sample.
I have read at following web site that If I render it as EMF then it will only render first page. and then I could use steamid.length to get the total pages.
I think you need "Image" as the first parameter to the Render method. EMF is already in the device info. When I do this the mime type comes out as "image/emf" and I can render the first page into a bitmap for printing, which works using some old code I have that expects EMF. Once the render has occurred the GetTotalPages property of the report is populated, though there's a warning in the manual about it being 'virtual pages' not physical pages - don't know what this means though, as it gives the correct answer in the project I'm working on.
I was searching for how to get subsequent pages, and I think your example has the clues I need, so thanks for that!