Wednesday, March 28, 2012

RSClientPrint Parameter Issues

Hi All

We're having a technical issue integrating the print reports into the portal. I'm hoping maybe some of your guys can help. We're using the RSClientPrint component to print the reports. The problem appears to be a conflict between the & in the URL and the & in the parameter value's cube reference. Below is an HTML code snippet. The 1st button works fine for us, it prints everything and has no & in the parameter's cube references. The second button references specific User and Employee values and therefore has & in the cube reference and generates an error. We tried encoding the & as & but it did not help. Thanks.

<html>
<body>


<OBJECT ID="RSClientPrint" CLASSID="CLSID:FA91DF8D-53AB-455D-AB20-F2F023E498D3"></OBJECT>

<script type="text/javascript">
function Print(ReportServer, ReportParameters, ReportTitle ) {
RSClientPrint.MarginLeft = .5 * 25.4;
RSClientPrint.MarginTop = .5 * 25.4;
RSClientPrint.MarginRight = .5 * 25.4;
RSClientPrint.MarginBottom = .5 * 25.4;
RSClientPrint.Culture = 1033;
RSClientPrint.UICulture = 1033;
RSClientPrint.PageWidth = 11 * 25.4;
RSClientPrint.PageHeight = 8.5 * 25.4;
RSClientPrint.Authenticate = false;
RSClientPrint.Print(ReportServer, ReportParameters, ReportTitle);
}

</script>


<button onclick="Print('http://localhost/reportserver', '/SA/SA.Report.6.Print&SessionSession=[Session].[Session].[All]&UserUser=[User].[User].[All]&TerritoryIdentifier=[Territory].[Identifier].[All]&EmployeeActiveFlag=[Employee].[Active Flag].[All]&EmployeeIdentifier=[Employee].[Identifier].[All]', 'SA.Report.6');"/>

<button onclick="Print('http://localhost/reportserver', '/SA/SA.Report.6.Print&SessionSession=[Session].[Session].&[1]&UserUser=[User].[User].&[1]&[1]&TerritoryIdentifier=[Territory].[Identifier].[All]&EmployeeActiveFlag=[Employee].[Active Flag].[All]&EmployeeIdentifier=[Employee].[Identifier].&[3356953]', 'SA.Report.6');"/>

</body>
</html>

Regards,

Nanda kumar R

&amp; is the encoding of & in xml, try using %26 which is the Url encoding of &.|||

Hi Daniel Reib,

Its working fine.

Thanks,

Regards,

Nanda kumar R

No comments:

Post a Comment