SAP Knowledge Base Article - Public

1184664 - "Print" and "Export" buttons are not working while placing Crystal Reports Viewer inside AJAX Update Panel control.

Symptom

"Print" and "Export" buttons are not working while placing Crystal Reports Viewer in AJAX Update Panel control.

It is the expected behavior while placing Crystal Reports Viewer inside update panel of AJAX control. All buttons in Crystal Report Viewer will work properly except "Print" and "Export" button.

Cause

Webpage was loaded (post backed) every time while pressing any of the buttons in your Crystal Reports Viewer after enabling "PostBackTrigger" property of AJAX update panel for your Crystal Reports viewer. Our print and export dialogs are displayed using a method in JavaScript called window.open() in our Crystal Reports Viewer.

 

In order for this to work the page is posted back to the server so that we can write window.open() at the bottom of the page. As by design of Crystal Reports, whenever you press the "Print" and "Export" button, our webpage will be getting post back. So, it is the expected behavior. Crystal Reports is not written to conform to AJAX standards so there are some features that do not work.

Resolution

How to workaround this issue?

 

1. Go into the properties of the UpdatePanel by right clicking it and selecting "Properties"
2. Find the "Triggers" in the properties and click on the "..." button to access the collection
3. Click the "Add" button and select "PostBackTrigger"
4. Set the ControlID on the right as the CrystalReportViewer control

 

Even if we followed the above-suggest steps, all buttons in Crystal Reports Viewer will work only with "post back" event even placed "Crystal Reports Viewers" inside update panel of the AJAX control. To workaround this issue, we would have to follow the above-suggested steps (or) we have to place the Crystal Reports Viewer normally without using AJAX control.

Keywords

Export print button Crystal Reports Viewer AJAX update panel , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

SAP Crystal Reports, version for Visual Studio .NET 2008 ; SAP Crystal Reports, version for Visual Studio .NET 9.1