CrystalReport学习

http://msdn.microsoft.com/en-us/library/ms227484(v=VS.90).aspx

 

参考示例要求安装Norwind数据库

 

1、找到instnwnd.sql文件

2、使用cmd进入命令提示符

3、使用osql -S serverName -U userName -P pwd -i instnwnd.sql进行安装

 

 

限定数据库访问链接的访问权限

1、创建一个新的访问账号

2、对这个账号授权

http://msdn.microsoft.com/en-us/library/ms227498(v=VS.90).aspx

 

创建WebSite项目

1、创建ASP.NET web网站

2、打开default.aspx

3、导入

 

 

4、添加一个私有的帮助方法HelperMethod

 

The ConfigureCrystalReports() method enables users to interact with the report at runtime. It also controls programmatic interaction with the report.

5、在page_init方法中调用ConfigureCystalReport方法

 

 

配置Web.config

在Default.aspx页面中,加入CrystalReportViewer,系统将自动在Web.config中添加如下内容

 

 

CrystalImageHandler

The CrystalImageHandler element displays all dynamic images in the CrystalReportViewer control. This setting configures the ASP.NET worker process to redirect requests made to CrystalImageHandler.aspx to an internal only image handler class. If you do not have the CrystalImageHandler setting in your Web.Config file, the images on your website will not show. This element is automatically added to the Web.Config file when you add the CrystalReportViewer control to your website.

 

CrystalImageCleaner

The CrystalImageCleaner process automatically deletes dynamically generated images rendered by the CrystalReportViewer control. This setting allows you to set the interval of time between scans of the image directory and the minimum age of the files before they are deleted. This element is automatically added to the Web.Config file when you add the CrystalReportViewer control to your website. This corresponds to the CrystalImageCleaner class.

  • CrystalImageCleaner-Sleep initializes the amount of time in milliseconds that the image cleaner sleeps before scanning and cleaning up image files in the dynamic image directory.
  • CrystalImageCleaner-Age initializes the minimum age in milliseconds of a file before it is deleted.
  • CrystalImageCleaner-AutoStart controls the CrystalImageCleaner process. The image cleaner cleans up the temporary images that are created when viewing a report whose value is set to true

 

printControl

The printControl element allows you to print the report directly to your local printer. By default, this control is not installed on your local machine and must be downloaded separately. You can download the PrintControl .cab file from the Business Objects technical support website: http://technicalsupport.businessobjects.com/. This setting makes the .cab file visible to your Crystal Reports.NET website. This element needs to be manually added to the Web.Config file of your website.

 

reportMappings

The reportMappings element updates websites created in Visual Studio 2003 that use embedded reports to non-embedded websites when opened in Visual Studio 2005 or later. This setting converts the .dll file created in Visual Studio 2003 to a disk file. Visual Studio 2005 and 2008 do not support embedded websites and you must modify your Web.Config file to ensure that your report is still functional with the newer version of Visual Studio. This element needs to be manually added to the Web.Config file of your website. The reportMappings setting requires an absolute path.

 

UseBrowserLocale

The UseBrowserLocale element retrieves the language settings in your browser for the CrystalReportViewer control. When set to true, this setting configures the CrystalReportViewer control to observe the browser locale. When set to false, this setting restricts the locale that is displayed page-by-page. This element needs to be manually added to the Web.Config file of your website.

 

serverFileReportManager

The serverFileReportManager element is a web service that enumerates the server files on the server machine. This setting allows you to get a list of objects (folders and reports) from a remote machine. This setting assigns the root of the file directory for the server. In this example, the root is set to c:/inetpub/wwroot. This element needs to be manually added to the Web.Config file of your website.

 

globalResourcePath

The globalResourcePath element is the reference to the file directory path for global resources. This file directory contains your custom language resources in a central location and can be shared across multiple web applications. This setting allows you to access the global resources in a specific website. In CrystalReports.NET, the default resource files are not shipped with the product install, but can be downloaded from the Business Objects technical support website:http://technicalsupport.businessobjects.com/. This element needs to be manually added to the Web.Config file of your website.

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值