Embed SSRS 2016 reports on another webpage without an iFrame?

Reporting-services 2016 (currently only available as a technical preview) comes with great updates, including rendering and HTML5 compliance. See: https://msdn.microsoft.com/en-us/library/ms170438.aspx

My desire is to embed SSRS 2016 reports in another web page using native mode (without Sharepoint or aspx, only pure HTML5). The traditional fashion to do this is to use iFrame. This is a halfway method because you can remove the toolbar, hide options, etc., but you still lose a lot of control over the document. This is a cross-site implementation from another domain, so I cannot manipulate the contained iFrame document as I like.

Is there an official way to embed a report element "natively"? I could imagine a URL parameter parameter, for example rs:Format=REPORTDIV , which serves as my html element.

I also tried to extract the report as an image ( rs:Format=IMAGE&rc:OutputFormat=PNG ), but the resulting PNG has a huge white frame (even when the background setting is transparent in the report builder) around the report element, which is non-go.

+8
reporting-services ssrs-2016
source share
1 answer

That should work. It should work outside the environment and also embed images from memory instead of retrieving them from the database.

 // Create service instance ReportExecutionServiceSoapClient rsExec = new ReportExecutionServiceSoapClient(binding, endpoint); rsExec.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; rsExec.ChannelFactory.Credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials; ReportingServices.Extension[] extentions = null; ReportingServices.TrustedUserHeader trustedUserHeader = new ReportingServices.TrustedUserHeader(); rsExec.ListRenderingExtensions(trustedUserHeader, out extentions); string reportPath = "/Untitled"; ExecutionInfo execInfo = new ExecutionInfo(); ExecutionHeader execHeader = new ExecutionHeader(); ReportingServices.ServerInfoHeader serverInfo = new ReportingServices.ServerInfoHeader(); string historyID = null; rsExec.LoadReport(trustedUserHeader, reportPath, historyID, out serverInfo, out execInfo); //Get execution ID execHeader.ExecutionID = execInfo.ExecutionID; string deviceInfo = null; string extension; string encoding; string mimeType; ReportingServices.Warning[] warnings = new ReportingServices.Warning[1]; warnings[0] = new ReportingServices.Warning(); string[] streamIDs = null; string format = "HTML5"; Byte[] result; rsExec.Render(execHeader, trustedUserHeader, format, deviceInfo, out result, out extension, out mimeType, out encoding, out warnings, out streamIDs); var report = Encoding.UTF8.GetString(result); int streamIdCount = streamIDs.Length; Byte[][] imageArray = new Byte[streamIdCount][]; String[] base64Images = new String[streamIdCount]; for (int i = 0; i <= streamIdCount - 1; i++) { Byte[] result2; string streamId = streamIDs[i]; rsExec.RenderStream(execHeader, trustedUserHeader, format, streamId, deviceInfo, out result2, out encoding, out mimeType); imageArray[i] = result2; base64Images[i] = Convert.ToBase64String(result2); string replace = string.Format("https://<reportserver>/ReportServer?%2FUntitled&rs%3ASessionID={0}&rs%3AFormat={1}&rs%3AImageID={2}", execInfo.ExecutionID, format, streamId); string src = string.Format("data:{0};charset=utf-8;base64, {1}", mimeType, base64Images[i]); report = report.Replace(replace, src); } 
+2
source share

All Articles