SAP Knowledge Base Article - Public

1196684 - How to change the default title in the title bar of the DHTML Java viewer

Symptom

You may want to change the default title in the title bar of the DHTML viewer when using the JRC application.

Cause

The default title for the DHTML viewer in JRC is set to '"Crystal Reports Viewer" but you have a business need to change the title.

Resolution

To change the title, use the following method:

public void addOnRenderScriptEventListener(OnRenderScriptEventListener listener)

throws java.util.TooManyListenersException

We can call this method on CrystalReportViewer class.

You can use the code snippet below to change the default title of DHTML Viewer:

CrystalReportViewer vi = new CrystalReportViewer();

vi.addOnRenderScriptEventListener(new OnRenderScriptEventListener() {

       public void onRenderScript(OnRenderScriptEvent event) {

               event.setScript("<script language=\"javascript\">document.title=\"Smart Java Viewer\";</script>");          

     };

});

Keywords

JRC+Tittle bar , 317164 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports XI ; SAP Crystal Reports XI R2