Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Progarmmatically register the ReportViewer Zoom

Author  Topic 

addytude
Starting Member

12 Posts

Posted - 2009-08-30 : 08:28:00
On the click of a HTML button, I fire the window.print() method to print a page which have a ReportViewer embedded. To make the report fit in the printout, i programmatically changed the zoom percentage before firing the print.
This was done by calling the .OnZoomChanged() javascript method. This method is the one that is automatically bound to the Zoom percentage dropdown in the toolbar of the ReportViewer. Everytime you change the dropdown value, the .OnZoomChanged() method gets called.

Problem is that I need to hide the toolbar. As a result, the OnZoomChanged() method doesn't get registered on the page. Is there some way of registering this method with the ReportViewer programmatically, such that the toolbar doesn't appear & yet the method is bound?

In the PrintButton click event i wrote:
ClientToolbarReportViewerKpiTrendData_ctl01.OnZoomChanged(80);

where "ClientToolbarReportViewerKpiTrendData" is the ReportViewerId. Since the toolbar is not hidden, this method is not getting bound to the toolbar.


<rsweb:ReportViewer ID="ReportViewerKpiTrendGraph" runat="server" ShowToolBar="false" ShowParameterPrompts="false" ZoomMode="Percent" ZoomPercent="100" >
<ServerReport ReportPath="/someReport" ReportServerUrl="http://someURL/ReportServer" />
</rsweb:ReportViewer>

   

- Advertisement -