Vaadin and Crystal Reports Viewer

I am developing a Crystal Report UI that allows you to pick which report you want to view and populate their parameters outside of the Crystal Report Viewer. Once you select everything, you then press a button and a Crystal Report Viewer will get called with all the stuff you selected earlier.

Here is my RequestHandler:

[code]
@Override
public boolean handleRequest(VaadinSession session,
VaadinRequest request, VaadinResponse response) throws IOException {
System.out.println(“Request: “+request.getPathInfo());
response.setContentType(“text/html; charset=UTF-8”);
String s = request.getPathInfo();
if(s.contains(”/theviewer”)){
ReportClientDocument clientDoc = new ReportClientDocument();
String fileName = “tester.rpt”;

        try {
            System.out.println("Hi!");
            clientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);
            clientDoc.open(fileName, OpenReportOptions._openAsReadOnly);
            USSCRJavaHelper.changeDataSource(clientDoc, username, password, "jdbc:oracle:connection", "oracle.jdbc.OracleDriver", "");
            CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();
            crystalReportPageViewer.setOwnPage(true);
            crystalReportPageViewer.setHasPrintButton(false);
            crystalReportPageViewer.setHasLogo(false);
            crystalReportPageViewer.setHasToggleParameterPanelButton(false);
            crystalReportPageViewer.setHasToggleGroupTreeButton(false);
            crystalReportPageViewer.setDocumentViewType(CrDocumentViewTypeEnum.webLayout);
            crystalReportPageViewer.setToolPanelViewType(CrToolPanelViewTypeEnum.none);
            IReportSource reportSource = clientDoc.getReportSource();
            crystalReportPageViewer.setReportSource(reportSource);
            crystalReportPageViewer.processHttpRequest((HttpServletRequest) request,(HttpServletResponse) response, VaadinServlet.getCurrent().getServletContext(), null);
        } catch (ReportSDKExceptionBase e) {
            System.out.println("IT FAILED!!!");
            e.printStackTrace();
        }
        return true;
    }
    return false;
}

[/code]but I get this error in the UI
"The viewer was unable to find the resources required to render the report.Please check the following to resolve the issue.

  1. Verify that crystalreportviewers/ is accessible to your WebApp and is the correct path to the viewer resources.
  2. You may customize this location by altering the crystal_image_uri and crystal_image_use_relative properties in the web.xml.
  3. Validate that the file crv.js exists at crystalreportviewers/js/crviewer/crv.js."

I’ve checked and these files do exsit under WebContent. But what I did notice, that is weird to me, is that the RequestHandler is trying to process them like requests.
“Request: /crystalreportviewers/js/crviewer/images/style.css
Request: /crystalreportviewers/js/crviewer/crv.js”

but when I did the Crystal Report Viewer as a regular HttpServlet (with no Vaadin) it worked just fine and I never saw those requests for the css or the js files.

I would guess I am over looking something simple, since I am not a Vaddin guru.

any advice would be helpful.

oh yea, here is the web.xml too

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>Report_Viewer</display-name>
  <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>
    <servlet>
        <servlet-name>CrystalReportViewerServlet</servlet-name>
        <servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>CrystalReportViewerServlet</servlet-name>
        <url-pattern>/CrystalReportViewerHandler</url-pattern>
    </servlet-mapping>
        <servlet>
        <servlet-name>ReportViewer</servlet-name>
        <servlet-class>cr.report.viewer.ui.ReportViewer</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ReportViewer</servlet-name>
        <url-pattern>/theviewer</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
</web-app>

After banging my head on the desk some more, I found out that the issue is cause by the VaadinUi webservlet’s value

@WebServlet(value = "/*", asyncSupported = true) I tired changing the value but it ended up causing more problems and making Vaadin not happy. So I banged my head on my keyboard and found a work around on the internet.

I added this to my web.xml

<servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>*.css</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>*.js</url-pattern> </servlet-mapping> and so far everything seems to be functioning like I need it to.

P.S. yes, I am a silly person.