cancel
Showing results for 
Search instead for 
Did you mean: 

Export and Print icons missing from report viewer

Former Member
0 Kudos

I'm currently embedding crystal within a wicket application in which I'm making use of the getHtmlContent() method to retrieve the report's HTML. For whatever reason, I'm not able to get either the export or print icons (on the top left side of the viewer). Is this because I'm using the getHtmlContent() method or do I have something misconfigured somewhere? Setting the setHasExportButton(true) and setHasPrintButton(true) on the report viewer object has no effect.

If I run the same report using the generated JSP outside of my application (within tomcat), I see the export/print buttons. I notice the JSP makes use of the processHttpRequest() method. Any help will be greatly appreciated.

Thanks!

Louis

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Louis

- The getHtmlContent() method handles the user's request to generate the HTML for the report and returns the HTML as a String.

Note: Either the getHtmlContent method or the processHttpRequest method can be used to handle the user's request to generate the HTML for the report, depending on how you write your JSP. If the viewer's content is displayed more than once, then the getHtmlContent method is more efficient, because the request is processed once and the resulting HTML string can be used multiple times. In this case, you must set the content type of the HTML, as recommended in the table. Additionally, using getHtmlContent sets setOwnPage to false and disables exporting and printing.

- The setOwnPage(true) and processHttpRequest() method should be used if you want the export and print button to appear in the report viewed through Crystal Report Viewer.

Following is the snippet of code which shows you how to use these 2 methods.

//Get the IReportSource object from sesion and pass it to the viewer

IReportSource reportSource = (IReportSource)session.getAttribute("reportSource");

//----


Create the viewer and render the report -


//create the CrystalReportViewer object

CrystalReportViewer oCrystalReportViewer = new CrystalReportViewer();

//set the reportsource property of the viewer

oCrystalReportViewer.setReportSource(reportSource);

//set viewer attributes

oCrystalReportViewer.setOwnPage(true);

oCrystalReportViewer.setOwnForm(true);

//set the CrystalReportViewer print mode

//oCrystalReportViewer.setPrintMode(CrPrintMode.ACTIVEX);

oCrystalReportViewer.setPrintMode(CrPrintMode.PDF);

//process the report

oCrystalReportViewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);

Hope this helps you .

Thanks

Soni

Former Member
0 Kudos

The processHttpRequest() is not an option for us. We're not using JSP but instead we're relying on the wicket web framework to handle the response. The processHttpRequest() appears to call getWriter() which causes an IllegalStateException("WRITER") to be thrown when the wicket framework eventually calls getOutputStream() (later in the response handling).

So if I hear you right, you're saying that the export/print buttons on the report viewer will not be available if we use the getHtmlContent() method. To get the the buttons to appear, we have to make use of the processHttpRequest() method, right?

Thanks!

Louis

Former Member
0 Kudos

Hi Louis

Yes ,the export/print buttons on the report viewer will not be available if we use the getHtmlContent() method.

Thanks

Soni

Former Member
0 Kudos

Hi Louis

When using the 'getHtmlContent' method with the CrystalReportViewer, the 'Export' and 'Print' buttons do not appear even though the 'isOwnPage' property is set to True.

This is the default behavior of the 'getHtmlContent' method.

To display these buttons, use the 'processHttpRequest' method and set the 'isOwnPage' property to True.

Thanks

Soni

Former Member
0 Kudos

Since processHttpRequest() is not an option for use we're kind of dead in the water. Is there any reason why the buttons don't show up when using getHtmlContent()? Can you tell me if the export/print buttons will be added to the getHtmlContent() in the future?

Thanks,

Louis

Former Member
0 Kudos

Hi Louis

For more information on getHtmlContent and processHttpRequest methods ,please refer the following link.

http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm

In that ,on the left hand side you have to go the Java Reporting component SDK->JRC API Reference.

I am not really aware if the export/print buttons will be available in the future with getHtmlContent method.

Thanks

Soni

Former Member
0 Kudos

Okay I was able to get around it by creating/feeding the processHttpRequest() method with a dummy response. I then could extract the html from it and it works fine.

Former Member
0 Kudos

Hi Louis!

Even I got stuck at the same place.... Will you please put the code snippet of your work around so all poor souls trying to set up Crystal Report Viewer with Wicket will be at ease.

Thanks in advance.

Answers (0)