cancel
Showing results for 
Search instead for 
Did you mean: 

Report Application Server SDK

Former Member
0 Kudos

Hello All,

I am trying to develop web application using Report Application server SDK.

But my example report will not get open...

code as follows.

<%@ page contentType="text/html; charset=utf-8"%>

<%@ page import="java.net.URLEncoder" %>

<%@ page import="com.crystaldecisions.sdk.occa.report.application.ReportClientDocument" %>

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

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

<%@ page import="com.crystaldecisions.sdk.occa.report.lib.ReportSDKException" %>

<%@ include file = "Utilities.jsp" %>

<%

/*

  • This page opens a report, extracts the names of all its tables, and then presents the

  • user with a selection list so that they can choose two tables. Following this

  • selection, ChooseLinking.jsp is loaded.

*/

%>

<%!

/*

  • Builds an HTML selection list containing the name of each table in the report.

  • The list permits multiple selections.

  • Parameters:

  • reportClientDocument

  • The ReportClientDocument object that will be inspected.

*

  • Returns: An HTML String containing the selection list.

*/

String createAvailableTablesMenu(ReportClientDocument reportClientDocument)

{

// Try to get the report's tables using its Database object.

Tables tables;

try

{

tables = reportClientDocument.getDatabaseController().getDatabase().getTables();

}

/*

  • If the tables cannot be read, or no tables are found, return a

  • descriptive HTML string.

*/

catch (ReportSDKException e)

{

return "<p>No tables available</p>";

}

if (tables.size() == 0)

{

return "<p>No tables available</p>";

}

// Create the HTML selection list.

String list = "<select name='SelectedTableNames' size='10' multiple>";

for (int i = 0; i < tables.size(); i++)

{

ITable table = tables.getTable(i);

list += "<option value='" + URLEncoder.encode(table.getAlias()) + "'>" +

table.getAlias() + "</option>";

}

list += "</select>";

return list;

}

%>

<%

/*

  • Try to open the report for this tutorial. If the open fails, redirect the user to an

  • error page. Note that CREATENEW_REPORT is string constant defined in Utilities.jsp

  • that identifies the report that is to be used with this tutorial.

*/

ReportClientDocument reportClientDocument = openReport("TargetReport_CreateNew", session);

if(reportClientDocument == null)

{

redirectWithError( "Error.jsp",

"The following report could not be opened:<i> " + CREATENEW_REPORT + "</i>",

response );

return;

}

%>

<html>

<head>

<link rel='stylesheet' type='text/css' name='stylelink' href='../tutss.css'>

</head>

<body>

<h4><%= session.getAttribute("TutorialName") %></h4>

<hr>

<form action='ChooseLinking.jsp' method='POST'>

<h5>Select two tables to add to the new report:</h5>

<%= createAvailableTablesMenu(reportClientDocument) %>

<p><input type="submit" class="button" value='Next'><p>

</form>

<hr>

</body>

</html>

Thanku...

Edited by: prashant joshi on Sep 30, 2008 2:49 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

dan_cuevas
Active Participant
0 Kudos

Hi Prashant,

Please kindly include the error you are encountering and the source code for the openReport() function.

Thanks.

Dan

Former Member
0 Kudos

Error is like "cannot open the respective report..."

I think so it is problem due to

managed and unmanaged report application server.

can you told me about that....

Thanks.

ted_ueda
Employee
Employee
0 Kudos

Without knowing how your openReport method is trying to retrieve the report, we can spend all day trying to guess what's at issue.

You're not providing enough info for others to help you here.

Sincerely,

Ted Ueda

Former Member
0 Kudos

Hi all,

my problem was due to Template report is not added into CMC

in case of Busines Object Enterprise.

so it will not get open because it is not available there.

Thanks.