查看使用受管理 RAS 服务器的报表
2008-01-11 10:24
423 查看
此实例说明如何使用查看器标记库来显示使用从受管理报表应用程序服务器中所获得报表源的报表。
查看使用受管理 RAS 服务器的报表
导入相应的类和库
登录到 Crystal Enterprise 并获取 InfoStore 对象。
在本例中,使用了默认管理员帐户来登录到与应用程序服务器运行在同一计算机上的 Crystal Enterprise 安装。
查询想要查看的报表。
为检索到的报表创建一个 RAS 报表源。
将 ReportSource 对象缓存在会话变量中。
这样,查看器将能够检索到该对象。
创建一个指定查看器名称、报表源类型和报表源变量的 viewer 标记。
在本例中,报表源类型为 reportApplicationServer,并且报表源变量是指您在其中存储了 ReportSource 对象的会话变量。
注意: ???本例中不需要 report 标记,因为报表源已缓存在会话变量中,并且不需要由查看器检索。
查看使用受管理 RAS 服务器的报表
导入相应的类和库
<%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr" %>
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession" %>
<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>
<%@ page import="com.crystaldecisions.sdk.occa.managedreports.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObject" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObjects" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2" %>
登录到 Crystal Enterprise 并获取 InfoStore 对象。
在本例中,使用了默认管理员帐户来登录到与应用程序服务器运行在同一计算机上的 Crystal Enterprise 安装。
<%
IEnterpriseSession es = CrystalEnterprise.getSessionMgr().logon("administrator", "", "localhost", "secEnterprise");
????IInfoStore infoStore = (IInfoStore) es.getService("", "InfoStore");
查询想要查看的报表。
IInfoObjects infoObjects = infoStore.query("SELECT * FROM CI_INFOOBJECTS WHERE SI_NAME='World Sales Report'");
????IInfoObject report = (IInfoObject) infoObjects.get(0);
为检索到的报表创建一个 RAS 报表源。
IReportSourceFactory2 reportFactory = (IReportSourceFactory2) es.getService ("", "RASReportFactory");
????Object reportSource = reportFactory.createReportSource(report, request.getLocale());
将 ReportSource 对象缓存在会话变量中。
这样,查看器将能够检索到该对象。
session.setAttribute("ReportSource", reportSource);
%>
创建一个指定查看器名称、报表源类型和报表源变量的 viewer 标记。
在本例中,报表源类型为 reportApplicationServer,并且报表源变量是指您在其中存储了 ReportSource 对象的会话变量。
<html>
<body>
<crviewer:viewer viewerName="CrystalViewer" reportSourceType="reportApplicationServer" reportSourceVar="ReportSource" />
</body>
</html>
注意: ???本例中不需要 report 标记,因为报表源已缓存在会话变量中,并且不需要由查看器检索。
相关文章推荐
- 服务器安装.net 时候提示:必须使用角色管理工具安装或配置microsoft.net framework的解决方法
- linux -- 如何查看服务器所使用的linux版本
- MySQL优化:使用show status查看MySQL服务器状态信息
- 如何查看哪些进程和服务器正在使用数据库
- 学习MongoDB--(5-2):索引(查看索引的使用,管理索引)
- 查看进程使用端口号及结束进程 使用命令 sudo netstat -ntlp,可以查看到目前系统网络服务器的运行情况,然后使用 sudo kill -9 pid,结束进程。
- 使用 dell openmanage server administrator 管理 服务器硬盘
- 操作必须使用一个可更新的查询;HTTP 500 - 内部服务器错误; 您未被授权查看该页;您不具备使用所提供的凭据查看该目录或页的权限;HTTP 错误 401.3 - 访问被资源 ACL 拒绝
- 使用iLO远程管理HP系列服务器英文版操作步骤
- svn查看日志显示连接服务器失败。你想使用缓存中的数据吗?
- 怎么在windows下使用vim + git 查看管理代码?
- 查看linux服务器内存使用情况free -m命令详解
- 如何使用图形界面Webmin管理linux服务器
- Ubuntu 16.04使用timedatectl进行管理时间(UTC/CST)(服务器/桌面)
- 源代码管理之SVN服务器搭建和使用
- jconsole连接linux服务器查看JVM使用情况,服务器配置记录
- 使用一台window server 2003主机,管理多台多台子服务器的远程登录
- 系统管理系列--01BE备份系统提示“无法使用其指定的登录账户登录服务器”
- wdcp wdCP是WDlinux Control Panel的简称,是一套通过WEB控制和管理服务器的Linux服务器管理系统以及虚拟主机管理系统,旨在易于使用Linux系统做为我们的网站服务器系