Hi all
I'm using Business Objects Crystal Reports.I want to add my Custom print image and javascript.I can remove the default toolbar.But I cant able to add the custom javascript to the image i inserted in the crystal report.Please Help.

Dani AI

Generated

— this is a rendering limitation of Crystal Reports rather than a JSP problem (as suggested). Objects you place inside an .rpt are rendered by the CR engine and usually become static image/html fragments; client-side event attributes (onclick, embedded script) are not preserved in the viewer output, so you cannot reliably attach JavaScript to an image that lives only inside the report.

Practical workarounds that work reliably:

  1. Build your toolbar in the JSP page, not inside the report. Hide the viewer toolbar and put your print/export icons next to the viewer. Have those icons call either the viewer/client API (if available for your CR version) or a server endpoint that exports the report to PDF and returns it inline — then open that PDF in a new window and call window.print(). This approach is cross-browser and avoids trying to inject script into CR output.

  2. Use the report object’s Hyperlink feature to point to a normal web URL in your application. Format Graphic -> Hyperlink -> specify a website or URL formula. Point it to a servlet/URL that performs the action you want. Avoid relying on "javascript:" URLs — many viewers sanitize or block them.

  3. If you must make specific regions clickable, overlay HTML elements (position:absolute) on top of the rendered report image(s). This is brittle (scaling/zoom issues) but sometimes practical for single-view layouts.

Notes and cautions: behavior differs by CR version and viewer (Java/ActiveX/HTML export). Test each approach across the browsers and viewer mode you use. If you have access to the Java Reporting Component (JRC) APIs, server-side export/print via the API is the most robust solution.

Recommended Answers

All 2 Replies

This has nothing to do with JSPs, better find a forum specific to Crystal Reports.

This has nothing to do with JSPs, better find a forum specific to Crystal Reports.

Thank you for your response.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.