Skip to Content
0
Former Member
Jun 27, 2014 at 10:01 PM

jsf reportPageViewer displays blank

111 Views

Hi there,

For the last week I've been struggling to try to implement a crystal report viewer in my jsf webapp.

My environment is crystal reports 2011 processing server and report application server 2011, and the version of BO is SAP BusinessObjects Enterprise XI 4.0

The implementation of jsf being used is sun faces 2.2.5.

At one point I was able to get my project error-free, but it resulted in just a blank page (other than other html output).

In reading through the xi4_rasjava_dg_en developer guide, I know i need to

  • 1.Copy the required JAR files into your web application.
  • 2.Deploy the CrystalReports.war file with your web application.
  • 3.Edit your web.xml file.


1. I have the appropriate com.crystaldecisions jars (which are imported via maven dependency declarations),

2. I can't seem to find the crystalreports.war (the dev guide said \Program Files\Business Objects\BusinessObjects Enterprise 12.0\java\applications on Windows). My local installation doesn't have a java folder, and I'm told that the serverside installation does have a java folder but doesn't have any war files.

3. My web.xml looks like this:

<servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <context-param>
        <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <context-param>
    <param-name>crystal_image_uri</param-name>
    <param-value>crystalreportviewers</param-value>
    </context-param>
    <context-param>
    <param-name>crystal_image_use_relative</param-name>
    <param-value>webapp</param-value>
    </context-param>

There is also mention of a crystalreportviewers folder to be placed parallel to the WEB-INF folder, but I haven't figured out what it is for, other than "contains the support files required by the viewers." It does seem to be referenced as the crystal_image_uri though.

My JSF xhtml file contains this:

<h:body>
    <!--ui:include src="header.xhtml" /-->
    <f:view>
        <h:form id="viewerForm">
            Test
            <bocrv:reportPageViewer viewerName="CrystalViewer"
            reportSource="#{reports.reportSource}"
            displayToolbarRefreshButton="false"
            allowDatabaseLogonPrompting="false"
            allowParameterPrompting="false"
            displayGroupTree="false"
            displayToolbarLogo="false"
            displayToolbarToggleTreeButton="false"
            enablePageToGrow="false" height="540"
            zoomPercentage="100" width="750"
            allowDrillDown="false"
            displayToolbarPrintButton="true"
            printMode="#{reports.printMode}"
            ></bocrv:reportPageViewer>
            Test2
        </h:form>
    </f:view>
    <!--ui:include src="footer.xhtml" /-->
</h:body>

And the Reports.java backing bean includes:

public Reports() throws IOException, SDKException
    {
        LOGGER.info("Reports()");
        setPrintMode(CrPrintMode.fromString("ActiveX"));
        setReportSource(getManagedReportSource("S0010_HHR_A_Transfer_Details"));
    }
    //endregion


    IReportSource getManagedReportSource(String reportName) throws SDKException, IOException
    {
        LOGGER.info("username: hhrpt, password: handheld, CMS: berlin-b, service: secEnterprise");
        IEnterpriseSession enterpriseSession = CrystalEnterprise.getSessionMgr().logon("username", "pass", "server", "secEnterprise");
        IReportSourceFactory reportSourceFactory = (IReportSourceFactory) enterpriseSession.getService("", "PSReportFactory");


        IInfoStore infostore = (IInfoStore) enterpriseSession.getService("InfoStore");
        IInfoObjects reports = infostore.query("Select SI_ID, SI_CUID From CI_INFOOBJECTS Where SI_NAME='" + reportName + "' And SI_INSTANCE=0");
        IInfoObject report = (IInfoObject)reports.get(0);


        LOGGER.info("CUID of report: " + report.getCUID());
        String reportID = "cecuid:///" + report.getCUID() + "";
        IReportSource reportSource = reportSourceFactory.openReportSource(reportID, java.util.Locale.ENGLISH);


        if(reportSource != null)
        {
            LOGGER.info("report source found");
        }
        return reportSource;
    }

which at one point i was able to see successfully get the CIUD and the reportsource.

However, I'm thinking my main problem might be not having a CrystalReports.war....if I can't seem to locate it, where else should I be able to get it?

Is there anything else I'm clearly doing wrong? It seems difficult to find information or examples on successful implementations of a crystal report viewer in a jsf webapp.

Thanks,

Jeremy