on 09-30-2008 1:48 PM
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
Hi Prashant,
Please kindly include the error you are encountering and the source code for the openReport() function.
Thanks.
Dan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.