Results 1 to 1 of 1
  1. #1
    Join Date
    Jul 2004

    Question Unanswered: A question about Crystal Report 10 JRC + Tomcat + Oracle9i

    Hi there,

    Currently, I am having a problem to use Crystal Report 10 (Dev version)'s Java Reporting Component(JRC) in my JSP files. What I want is using the JRC to open a report having an ODBC connection to the Oracle 9i database. However, I am having a big problem to login to the Oracle 9i database. I did everything I could think of without luck. Fortunately, I found this place and you might be a professional can help me.

    What I did is just following Crystal Report’s sample. However, I always got an error message of database “Logon failed” when I tried to open a report retrieving data from the database “EPLTS_NT”.

    My system: Windows2000/SP3 + Crystal Report 10 JRC + Apache Tomcat 4.1.27 +
    Oracle to view ODBC reports in JSP files.

    What I have done for the database connection:
    1. Put Oracle 9i JDBC driver file ojdbc14.jar/ojdbc14_g.jar in $CATALINA_HOME\common\lib
    2. Created a ODBC system data source called EPLTS_NT in my system. Tested the connection to the EPLTS_NT for being sure it is OK.
    3. Modified web.xml file in $CATALINA_HOME\webapps\ROOT\WEB-INF directory.

    The code below is my JSP file:
    /************************************************** ****
    CrystalReportViewer viewer = new CrystalReportViewer();

    String report = "/reports/odbcData.rpt";
    IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
    IReportSource reportSource = (IReportSource) rptSrcFactory.createReportSource(report, request.getLocale());


    //Create the ConnectionInfo Objects
    ConnectionInfos connInfos = new ConnectionInfos();
    IConnectionInfo connInfo = new ConnectionInfo();

    //Set the connection info properties

    //Pass the connectionInfos to the viewer.

    //Set the viewer not prompting logon process

    //@ Print out the connection info for debug
    out.println(viewer.getDatabaseLogonInfos().getConn ectionInfo(0).getAttributes().toString());

    viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);

    ** END of my JSP file********************************************** *****/

    Below is what I added to $CATALINA_HOME\webapps\ROOT\WEB-INF \web.xml file for the database JNDI mapping:

    /************************************************** *****
    ************************************************** *****/
    Note: EPLTS_NT is ODBC DSN on my machine and EPLTSCR is database name on the server.

    The result from CR view in IE6:

    /************************************************** **** rtViewer
    Logon failed

    // My output info about the connection info:
    {Server Name=EPLTS_NT, Connection String=DSN=s(EPLTS_NT);UseDSNProperties=b(false);P assword=;User ID=s(EPLTS_NT);DatabaseDLL=s(crdb_odbc.dll), Database Name=, Database DLL=crdb_odbc.dll}
    ************************************************** ****/

    I believe I post all info about my problem. Please tell me if you find anything incorrect or missing. For example, in the connection info, the password value is missing. Is it normal?

    Any idea would be greatly appreciated! If possible, could you send me a sample (Server.xml (if needed), Web.xml and JSP files) simply connecting how to connect to Oracle database?

    Thank you very much for your time and consideration,

    Last edited by jayLee; 07-16-04 at 12:57.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts