ActiveReports 14 .NET Edition
ActiveReports 14 User Guide / Preview Reports / ASP.NET / Using Javascript with the HTML Viewer
In This Topic
    Using Javascript with the HTML Viewer
    In This Topic

    To use JavaScript with the WebViewer, initialize the WebViewer's view model using the clientId returned from the WebViewer. Once you initialize the view model, you can access its API methods and properties to modify the WebViewer. You can also use the same view model to access the API for the side bar search panel and the toolbar.

    Note: You can get the ClientId from the WebViewer control. By default, it is WebViewer1.

    ViewerViewModel

    To work with the API, first initialize the viewer's view model using the GetWebViewer(clientId) function. The clientId is the WebViewer control's name, by default, WebViewer1. If there is no ViewerViewModel with the requested clientId, an exception occurs.

    Use code like the following to initialize the ViewerViewModel:

    var viewModel = GetWebViewer(clientId);

    See Also