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:\\1 92.168.160 .2;SID=o
jdbc driver: com.ddtek.jdbc.oracle.Orac leDriver
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;cha rset=UTF-8 "%>
<%@ page import="com.crystaldecisio ns.report. web.viewer .CrystalRe portViewer "%>
<%@ page import="com.crystaldecisio ns.reports .reporteng ineinterfa ce.JPERepo rtSourceFa ctory"%>
<%@ page import="com.crystaldecisio ns.sdk.occ a.report.d ata.Connec tionInfo"% >
<%@ page import="com.crystaldecisio ns.sdk.occ a.report.d ata.Connec tionInfos" %>
<%@ page import="com.crystaldecisio ns.sdk.occ a.report.d ata.IConne ctionInfo" %>
<%@ page import="com.crystaldecisio ns.sdk.occ a.report.r eportsourc e.IReportS ource"%>
<%@ page import="com.crystaldecisio ns.sdk.occ a.report.r eportsourc e.IReportS ourceFacto ry2"%>
<%@ taglib uri="netui-tags-databindin g.tld" prefix="netui-data"%>
<%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
<%@ taglib uri="netui-tags-template.t ld" 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.createReport Source(rep ort,reques t.getLocal e());
CrystalReportViewer viewer = new CrystalReportViewer();
ConnectionInfos connInfos = new ConnectionInfos();
IConnectionInfo connInfo = new ConnectionInfo();
connInfo.setUserName("scot t");
connInfo.setPassword("tige r");
connInfos.add(connInfo);
viewer.setOwnPage(true);
viewer.setReportSource(rep ortSource) ;
viewer.setDatabaseLogonInf os(connInf os);
viewer.setEnableLogonPromp t(false);
viewer.setZoomFactor(100);
viewer.setHasSearchButton( false);
viewer.setHasLogo(false);
viewer.setHasPrintButton(t rue);
viewer.setDisplayGroupTree (false);
viewer.refresh();
viewer.processHttpRequest( request, response, getServletConfig().getServ letContext (), null);
viewer.dispose();
}
catch(Exception e)
{
System.out.print(e.getMess age());
}
%>
</p>
</body>
</netui:html>
I used the following jdbc params in designer.
jdbc url: jdbc:datadirect:oracle:\\1
jdbc driver: com.ddtek.jdbc.oracle.Orac
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;cha
<%@ page import="com.crystaldecisio
<%@ page import="com.crystaldecisio
<%@ page import="com.crystaldecisio
<%@ page import="com.crystaldecisio
<%@ page import="com.crystaldecisio
<%@ page import="com.crystaldecisio
<%@ page import="com.crystaldecisio
<%@ taglib uri="netui-tags-databindin
<%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
<%@ taglib uri="netui-tags-template.t
<netui:html>
<head>
<title>
Web Application Page
</title>
</head>
<body>
<p>
<%try
{
String report = "report1.rpt";
IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
IReportSource reportSource = (IReportSource) rptSrcFactory.createReport
CrystalReportViewer viewer = new CrystalReportViewer();
ConnectionInfos connInfos = new ConnectionInfos();
IConnectionInfo connInfo = new ConnectionInfo();
connInfo.setUserName("scot
connInfo.setPassword("tige
connInfos.add(connInfo);
viewer.setOwnPage(true);
viewer.setReportSource(rep
viewer.setDatabaseLogonInf
viewer.setEnableLogonPromp
viewer.setZoomFactor(100);
viewer.setHasSearchButton(
viewer.setHasLogo(false);
viewer.setHasPrintButton(t
viewer.setDisplayGroupTree
viewer.refresh();
viewer.processHttpRequest(
viewer.dispose();
}
catch(Exception e)
{
System.out.print(e.getMess
}
%>
</p>
</body>
</netui:html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad i could help
mlmcc
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.
Good luck.
ASKER
Well, thanks for at least trying!