Developers can send a request to the Report Viewer Module to render a specific report. This can be achieved by sending a message to the report viewer module using the Shell Messenger. You can access the Shell Messenger instance within the ViewService of the WorkspaceViewModel object.

The ReportViewer module is listening to two topics on the Shell Messenger. They are "ReportViewerShowWorkspace" and "ReportViewerShowDialog". The message type for both topics are string.

To send a request, find the Report.xsd file in the SSRSViewer Project. Use the xsd.exe to generate an proxy class for serialization and add that class to your project. You can then create a Report object, populate it with report parameters, serialize it and send it using the Messenger. See the sample code below.
	Report report = new Report();
	report.ServerName = "Prod";
	report.Name = "Test";
	report.Path = "/Reports/Albatross/CMS/Contacts";
	report.ShowTree = false;
	report.Param = new Parameter[] { new Parameter() { Name = "Test", Value = "123" } };
	StringBuilder sb = new StringBuilder();
	using (StringWriter writer = new StringWriter(sb)) {
		XmlSerializer serializer = new XmlSerializer(typeof(Report));
		serializer.Serialize(writer, report);
	}
	ViewService.ShellMessenger.Send<string>(sb.ToString(), "ReportViewer_ShowWorkspace"); 

Last edited Jul 29, 2014 at 3:38 AM by rushui, version 4