Link to home
Start Free TrialLog in
Avatar of lcor
lcor

asked on

Crystal Reports and Logging with the JRC DB Failure

I am using the JRC.  I downloaded DataDirect JDBC libraries and successfully was able to create a report in Crystal Designer.

I used the following jdbc params in designer.

jdbc url:  jdbc:datadirect:oracle:\\192.168.160.2;SID=o
jdbc driver:  com.ddtek.jdbc.oracle.OracleDriver

The designer connected and displayed table and data succesfully.

Now when I go to run the report in my jsp, I get database login failure.

I don't understand because I  set IConnectionInfo OK.

What could be going wrong?


<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer"%>
<%@ page import="com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.ConnectionInfo"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.ConnectionInfos"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.IConnectionInfo"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2"%>
<%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
<%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
<%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
<netui:html>
<head>
<title>
Web Application Page
</title>
</head>
<body>
<p>
<%try
{
String report = "report1.rpt";
IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
IReportSource reportSource = (IReportSource) rptSrcFactory.createReportSource(report,request.getLocale());

CrystalReportViewer viewer = new CrystalReportViewer();
ConnectionInfos connInfos = new ConnectionInfos();
IConnectionInfo connInfo = new ConnectionInfo();
connInfo.setUserName("scott");
connInfo.setPassword("tiger");

connInfos.add(connInfo);

viewer.setOwnPage(true);
viewer.setReportSource(reportSource);
viewer.setDatabaseLogonInfos(connInfos);
viewer.setEnableLogonPrompt(false);
viewer.setZoomFactor(100);
viewer.setHasSearchButton(false);
viewer.setHasLogo(false);
viewer.setHasPrintButton(true);
viewer.setDisplayGroupTree(false);

viewer.refresh();
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
viewer.dispose();
}
catch(Exception e)
{
System.out.print(e.getMessage());
}
%>
</p>
</body>
</netui:html>
 
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lcor
lcor

ASKER

Yes, login information is stored in the report using Crystal Designer.

Well, thanks for at least trying!
Glad i could help

mlmcc
I had a bunch of problems similar to the one you are describing.  I finally found luck with using an ODBC connection when using the designer and using a JDBC connection with the same name as the DSN that I used for the ODBC connection.

Good luck.