BusinessObject Enterprise SDK应用开发(中)
在上篇文章中对BusinessObject Enterprise SDK及相关的SDK进行了简单的介绍及环境配置中的LIB配置,在本文中主要讲述web.xml文件的配置:
2、Web项目中的web.xml文件配置:
在web.xml中可以配置的参数及其功能描述为(如想直接操作,可以跳至本文最后示例部分):
Sets the view type of the report view pane.
| |
Allows you to display exception information
| |
Allows you to log exception information
| |
Sets the location of the
crystalreportsviewers directory in your web application
| |
Sets the interpretation of the
crystal_image_uri to be relative to the web page, application, or server
| |
Sets the default number of values that will be returned in a list.
| |
Enables the Report Processing Indicator
| |
Modifies the text displayed by the Report Processing Indicator
| |
Enables asynchronous requests.
| |
Allows you to view the parameter panel in your web application, handles report exporting, interactive parameters, images, and charts
| |
Enables the use of JavaServer Faces (JSF) components in your web application
|
-
printlayout - Displays a grey background behind the report with a dropdown shadow cast by the report page. Shows the page layout of the report when printed.
-
weblayout - Fills the entire report view pane with the report. There is no grey background.
<context-param> <param-name>crystal_document_view</param-name> <param-value>weblayout</param-value> </context-param>
-
short - Displays the exception information without the accompanying stack trace.
-
long - Displays the exception information with the accompanying stack trace.
-
disable - Exception information is not displayed. The user must handle the exception.
<context-param> <param-name>crystal_exception_info</param-name> <param-value>long</param-value> </context-param>
<context-param>
<param-name>crystal_exception_log_file</param-name>
<param-value>c:/temp/webreportingexception.log</param-value>
</context-param>
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>/web_application_name/crystalreportviewers</param-value>
</context-param>
-
webapp - Sets the uri as relative to the web application directory.
-
server - Sets the uri as relative to the server root.
-
Page - Sets the uri is relative to the page from which the resources in the crystalreportviewers directory are requested.
<context-param> <param-name>crystal_image_use_relative</param_name> <param-value>webapp</param-value> </context-param>
<context-param> <param-name>crystal_max_number_parameter_default_values</param-name> <param-value>100</param-value> </context-param>
<context-param> <param-name>crystal_processing_indicator_delay</param-name> <param-value>0</param-value> </context-param> <context-param> <param-name>crystal_processing_indicator_text</param-name> <param-value>some text</param-value> </context-param>
<context-param> <param-name>crystal_processing_indicator_delay</param-name> <param-value>0</param-value> </context-param> <context-param> <param-name>crystal_processing_indicator_text</param-name> <param-value>some text</param-value> </context-param>
<context-param> <param-name>crystal_use_asynchronous_requests</param-name> <param-value>false</param-value> </context-param>
<servlet>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<url-pattern>/CrystalReportViewerHandler</url-pattern>
</servlet-mapping>
-
load-on-startup - When the value is set to 0, the servlet does not load on startup. When the value is set to 1, the servlet loads on startup.
-
url-pattern – Sets the path to the Faces Servlet.
-
javax.faces.application.CONFIG_FILES parameter value – Sets the location of the faces-config.xml file. You must create this file when setting up a JSF project. For more information see:
<listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup> 1 </load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping> <context-param> <param-name>javax.faces.application.CONFIG_FILES</param-name> <param-value>/WEB-INF/faces-config.xml</param-value> </context-param>
一般项目中只需简单作如下配置即可,(如果使用BusinessObject Enterprise SDK,可以不进行任何配置):
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>web_application_name</display-name>
<context-param>
<param-name>crystal_image_uri</param-name><!--viewer中图片位置-->
<param-value>/web_application_name/crystalreportviewers</param-value>
</context-param>
<context-param>
<param-name>crystal_servlet_uri</param-name>
<param-value>/CrystalReportViewerHandler</param-value>
</context-param>
<servlet>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<url-pattern>/CrystalReportViewerHandler</url-pattern>
</servlet-mapping>
</web-app>
如使用RAS、Viewer其它的功能,请参见相关配置。