views:

1634

answers:

1

I have a WinForms application that can call for and display a number of reporting services reports. I can call the LocalReport.Render("Excel", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings); method - writing to a byte[] array, but it throws an exception "The source of the report definition has not been specified". Does anyone know how to solve this?

Thanks,

A

A: 

Use the following param for the 2nd parameter.

<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>

And you need to setup the report with something like:

var MyInfo = MyRS.LoadReport("/" + reportPath, null);
var ReportDeviceInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
String ExtensionValue = String.Empty;
String EncodingValue = String.Empty;
String MimeTypeValue = String.Empty;
Warning[] WarningValue = null;
String[] StreamIDsValue = null;

var Result = MyRS.Render("Excel", ReportDeviceInfo, out ExtensionValue, out EncodingValue, out MimeTypeValue, out WarningValue, out StreamIDsValue);
JasonRShaver