Skip to Content
0
Jul 28, 2009 at 08:13 PM

"Error finding JNDI name "

52 Views

Hi,

Env: CR 2008

SDK: JRC

Tomcat: 5.5

I had met a problem when I use the JRC sample code to set database connectoin to report connect to BW query (Through integraion Kit for SAP).

The error message is "Error finding JNDI name (Souce IP)"

I don't know why. Any comment would be help.

Here is my source code

<%@ page import= "com.crystaldecisions.report.web.viewer.*" %>

<%@ page import= "com.crystaldecisions.sdk.occa.report.data.*"%>

<%@ page import= "com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory" %>

<%@ page import= "com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2" %>

<%@ page import= "com.crystaldecisions.sdk.occa.report.reportsource.IReportSource"%>

<%

ConnectionInfos connInfos = new ConnectionInfos();

IConnectionInfo connInfo1 = new ConnectionInfo();

String userName = "admin";

String passWord = "admin";

connInfo1.setUserName(userName);

connInfo1.setPassword(passWord);

String conn_kind = connInfo1.getKind().toString();

// out.println(conn_kind);

connInfos.add(connInfo1);

// String LogonChoice = (String)session.getAttribute("LogonChoice");

String LogonChoice = "parameter1";

Object reportSource = session.getAttribute("reportSource");

CrystalReportViewer viewer = new CrystalReportViewer();

viewer.setReportSource(reportSource);

viewer.setOwnPage(true);

viewer.setOwnForm(true);

viewer.setPrintMode(CrPrintMode.PDF);

if (LogonChoice.equals("parameter"))

{

viewer.setEnableLogonPrompt(true);

}

else

{

viewer.setEnableLogonPrompt(false);

viewer.setDatabaseLogonInfos(connInfos);

}

if (session.getAttribute("refreshed") == null)

{

viewer.refresh();

session.setAttribute("refreshed", "true");

}

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

System.out.println("Here");

%>

Best Reards,

Fan