Title: Creating Crystal reports from XML generating servlets

Informational post
I finally had success using the new crystal reports Version 8.5 to generate a report from a servlet. As long as Seagate doesnt change anything we now have ultimate control over the data that crystal report's  displays all without a single line of VBScript.

There are a few gotchas though..
1) the XML encoding method MUST be   <?xml version="1.0" encoding="UTF-16" ?>  using   <?xml version="1.0" encoding="UTF-8" ?> will NOT work.

You can set this up with your transformer by
transformer.setOutputProperty(javax.xml.transform.OutputKeys.ENCODING,"UTF-16");

2) you need to map your servlet with a .xml extension. in your web.xml add a servlet-mapping
   <servlet-mapping>
        <servlet-name>
            MyServlet
        </servlet-name>
        <url-pattern>
            /MyServlet.xml
        </url-pattern>
    </servlet-mapping>
Crystal reports automatically expects an xml extension. However when it prompts you for the table name you can send parameters like MyServlet?report_data_type=4 and these parameters will be recieved by the server.

3) Set the table hints and row hints as specified by crystal reports

Reply via email to