BusinessObject Enterprise SDK应用开发(中)

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

   

crystal_document_view
Sets the view type of the report view pane. The crystal_document_view parameter value can be set to one of the following values:
  • 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.

Note: If the crystal_document_view parameter is not specified, it is set to printlayout by default.
<context-param>
        <param-name>crystal_document_view</param-name>
        <param-value>weblayout</param-value>
</context-param>
crystal_exception_info
Allows you to display exception information. If you do not display exception information you can still log the exception information if you use the crystal_exception_log_file setting. The crystal_exception_info parameter value can be set to one of the following values:
  • 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.

Note: If the crystal_exception_info parameter is not specified, it is set to short by default.
<context-param>
        <param-name>crystal_exception_info</param-name>
        <param-value>long</param-value>
</context-param>
crystal_exception_log_file
Allows you to log exception information. The parameter value specifies the location of the log file. Regardless of the setting of the crystal_exception_info parameter, the exception information output to the log file will be in the long format.

Note: By default, exceptions are not logged.
<context-param>
        <param-name>crystal_exception_log_file</param-name>
        <param-value>c:/temp/webreportingexception.log</param-value>
</context-param>
crystal_image_uri
Sets the location of the crystalreportsviewers directory in your web application. This setting must be included in the web.xml file if you are using a report viewer in your web application. The crystalreportviewers directory contains all files required by the viewer.
<context-param>
         <param-name>crystal_image_uri</param-name>
         <param-value>/web_application_name/crystalreportviewers</param-value>
</context-param>
crystal_image_use_relative
Sets the interpretation of the crystal_image_uri to be relative to the web page, application, or server. The parameter value can be set to one of the following values:
  • 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>
crystal_max_number_parameter_default_values
By default, the Java DHTML viewers return a maximum of 200 values per list at a time. The crystal_max_number_parameter_default_values parameter value overrides this default size. If a list exceeds the default size of 200, or the number set by this parameter, a link to the remaining values is displayed.
<context-param>
         <param-name>crystal_max_number_parameter_default_values</param-name>
			      <param-value>100</param-value>
</context-param>
crystal_processing_indicator_delay
The Report Processing Indicator will present specific feedback regarding both general processing status and print processing status. By default, the Report Processing Indicator will display for any postback action longer than 500 ms. The crystal_processing_indicator_delay parameter value overwrites the default delay of 500 ms. You can specify any non-negative number in milliseconds. When the parameter value is set to 0, the report processing indicator is disabled.

Note: This feature works only when using a Java DHTML viewer. This feature is currently implemented only for Internet Explorer browsers.
<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>
crystal_processing_indicator_text
The Report Processing Indicator will present specific feedback regarding both general processing status and print processing status. The crystal_processing_indicator_text parameter value modifies the text displayed by the Report Processing Indicator.

Note: This feature works only when using a Java DHTML viewer. This feature is currently implemented only for Internet Explorer browsers.
<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>
crystal_use_asynchronous_requests
By default, asynchronous requests are permitted within the DHTML viewer. If you wish to enable the Back button in the user's browser to work with the DHTML viewer, you must disable asynchronous requests by setting this parameter to false.

Note: It is recommended that you do not set the crystal_use_asynchronous_requests parameter to false. Doing so will disable some viewer performance enhancemenets and enhanced appearance features.
<context-param>
	<param-name>crystal_use_asynchronous_requests</param-name>
	<param-value>false</param-value>
</context-param>
CrystalReportViewerServlet
The CrystalReportViewerServlet allows you to view the parameter panel in your web application. The servlet allows the Java DHTML viewers to export and print when the viewers are embedded in other content. The servlet also handles interactive parameters, images, and charts. This setting must be included in the web.xml file if you are using a report viewer in your web application.
 
<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>
Faces Servlet
Enables the use of JavaServer Faces (JSF) components in your web application. This setting must be included in the web.xml file if you are using JSF components or beans in your web application.
  • 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其它的功能,请参见相关配置。

          

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值