水晶报表使用方法

欢迎C#高手加盟QQ群:9340166

 

水晶报表VS2010版IDE安装标准版SAP Crystal Reports, version for Visual Studio 2010 - Standard:

下载地址: http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_1.exe  

下载安装后打开VS2010就可以在左边工具栏中看到CRYSTALREPORTVIEWER,并且可以新建水晶报表了;

用法跟以前版本的用法类似;  不过要注意下面几点;

a. 运行环境不能为.NET FRAMEWORK 4.0 CLINET PROFILE,要改为.NET FRAMEWORK 4,选中项目右键属性就可以更改了;

b.在项目中加一个APP.CONFIG(这是针对WINFORM项目),如果是WEB项目就不用加了,里面有一个WEB.CONFIG;在这配置文件中加上  <startup useLegacyV2RuntimeActivationPolicy="true">

   <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>

这可以避免ADO.NET与水晶报表运行时由于.NET版本问题出错

 (1)下面做一个简单的水晶报表,在项目中建一个窗体FORM1,一个水晶报表CrystalReport1,一个数据集DATASET1;(水晶报表的设置跟以前版本的一样)

在窗体上放一个CRYSTALREPORTVIEWER,然后在FORM1的LOAD事件下写上;我这是把水晶报表放在DEBUG这个文件夹下动态加载的;你也可以直接放在项目中在CRYSTALREPORTVIEWER上指定报表名称;

private void Form1_Load(object sender, EventArgs e)

        {

            SqlConnection con = new SqlConnection("Data Source=10.100.100.5;Initial Catalog=cldz;User ID=proc4;Password=77cc88");

            con.Open();

            SqlDataAdapter da = new SqlDataAdapter("select top 100 * from ZZZPJ", con);

            DataSet ds = new DataSet();

            da.Fill(ds, "ZZZPJ");

            string reportPath = Application.StartupPath + @"\CrystalReport1.rpt";

            ReportDocument rd = new ReportDocument();

            rd.Load(reportPath);

            rd.SetDataSource(ds.Tables[0].DefaultView);

            this.crystalReportViewer1.ReportSource = rd;         

        } 

(2)vs2010水晶报表的发布有两种方式;

一是直接下载MSI文件安装在客户端,客户端就可以用了;32位的下载上面的;如果是64位的下载下面的;

水晶报表VS2010版运行时32位和64位单独安装包:

32位下载地址:http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_32bit_13_0_1.zip

64位下载地址:http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_64bit_13_0_1.zip

二是下载上面水晶报表VS2010版合并模块安装包文件,里面第一个是CRRuntime_13_0_1.msm这个是英文包;如果需要支持中文就加一个MSM,( CRRuntime_13_0_1_zh_cn.msm); 另外加一个CRRuntime_13_0_1_maps.msm 这个可以不用;合并模块安装包下载地址:http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_mergemodules_13_0_1.zip 

用VS2010自带的打包软件打包发布,新建一个安装项目,安装项目的制作过程这里就不详细说了,跟VS2005的制作过程一样(参见部署包含水晶报表Crystal Reports 的VS.NET2005应用程序[原创]:http://hi.baidu.com/jcserver/blog/item/5629e018eccef3ac4aedbc9a.html);

制作完后,右键项目选添加―― 合并模块―― 把上面提到的三个以.MSM结尾的文件加入进去,最后确定。

[

特别说明:

有的网文中说需要把

C:\Program Files\Common Files\Merge Modules文件夹中类似Microsoft_VC100_*_x86.msm的MSM文件也加入进去

    如果是32位的就加x86的(Microsoft_VC100_ATL_x86.msm、Microsoft_VC100_CRT_x86.msm、Microsoft_VC100_DebugCRT_x86.msm、Microsoft_VC100_DebugMFC_x86.msm、Microsoft_VC100_DebugOpenMP_x86.msm、Microsoft_VC100_MFCLOC_x86.msm、Microsoft_VC100_MFC_x86.msm、Microsoft_VC100_OpenMP_x86.msm);

    如果是64位的就加x64的(Microsoft_VC100_ATL_x64.msm、Microsoft_VC100_CRT_x64.msm、Microsoft_VC100_DebugCRT_x64.msm、Microsoft_VC100_DebugMFC_x64.msm、Microsoft_VC100_DebugOpenMP_x64.msm、

Microsoft_VC100_MFCLOC_x64.msm、Microsoft_VC100_MFC_x64.msm、Microsoft_VC100_OpenMP_x64.msm ) 

   但是,经过JCSERVER的验证:类似Microsoft_VC100_*_x86.msm不用加进去,也可以在正常打印出水晶报表.建议你把CRRuntime_13_0_1.msm、CRRuntime_13_0_1_zh_cn.msm(中文简体语言包,如是其它语言请自行选择不同的语言包)、CRRuntime_13_0_1_maps.msm这三个模块加进去。

只是遇到过一个问题:在装有VS.NET 2010和Crystal Report For VS.NET2010的系统上,如果安装制作好的打包程序就会导致VS.NET2010创建或修改水晶报表文件时提示:"无效密钥号码"。如果你解决了此文件请给我说声,呵呵。我的邮箱:jcserver @ 163.com

 ]

 

说明: 在VS2010中按F1调出帮助文档,搜索”合并模块”关键字,你会看到更多的合并模块布署程序的帮助说明. 

 

 

     再右键项目选属性,点击“系统必备”按钮;在弹出的对话框中选中与你的程序对应版本的运行库(有32位的X86与64位的X64),注意根据系统选,有32与64位的;在下面的单选按钮中选第二项“从与我的应用程序相同的位置下载系统必备组件”;(如果你要安装.NET2.0的系统必备,VS2010安装项目的系统必备中没有.NET 2.0,不过我们可以从VS2008的程序文件中找到 .NET 2.0 的系统必备安装包。安装了VS2008 的 C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages 下的 DotNetFX 文件夹,就是 .NET 2.0 的系统必备安装包。把 DotNetFX 文件夹复制到安装了 VS2010 的 C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages下,然后在VS2010中就可以选择 .NET 2.0 的系统必备组件了。我已将.NET 2.0 的系统必备组件制作为安装包,下载地址:http://download.csdn.net/detail/hiwcn/3665808)

 

这样发布的准备工作就做完了,选择菜单上的生成―― 生成项目或者右键项目点生存就可以了;

注意:(我在上面所有提到的“项目”不是VS工具栏上面菜单中的“项目”;是你解决方案下的项目,比如你新建了一个安装项目叫SETUP1,那就是指SETUP1)

如果制作好的安装程序在安装过程中出未能注册某一个模块请到下面网址下载一个适合你系统版本的文件安装,就可以避免出错了。

 

 

水晶报表VS2010版安装包,请选择下载(JcServer整理http://soft.hiw.cn): 

1、水晶报表VS2010版IDE标准安装包: 应用于VS2010版的水晶报表EXE文件标准安装包。 SAP Crystal Reports, version for Visual Studio 2010 - Standard Standard EXE installation package which installs the software into the Visual Studio IDE. 下载地址 :http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_1.exe 

2、水晶报表VS2010版运行时32位和64位合并安装包: 点击一次安装包,用来创建应用程序窗口的自动运行的升级包可以安装并运行与最小的用户交互。 SAP Crystal Reports, version for Visual Studio 2010 - Click Once Click once installation package used to create self-updating Windows-based applications which can be installed and run with minimal user interaction. 下载地址:http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_clickonce_13_0_1.zip

3、水晶报表VS2010版运行时32位和64位单独安装包: 点击一次安装包,用来创建应用程序窗口的self-updating可以安装并运行与最小的用户交互。

SAP Crystal Reports, version for Visual Studio 2010 - Click Once (32 Bit) 下载地址:http://downloads.businessobjects.com/akdlm/crnetruntime/clickonce/CRRuntime_32bit_13_0_1.msi

SAP Crystal Reports, version for Visual Studio 2010 - Click Once (64 Bit) 下载地址:http://downloads.businessobjects.com/akdlm/crnetruntime/clickonce/CRRuntime_64bit_13_0_1.msi

4、水晶报表VS2010版合并模块安装包: 合并模块安装包, 用于安装多个应用程序共享的组件,用于以VS2010程序安装包方式步署水晶报表的组件。

SAP Crystal Reports, version for Visual Studio 2010 - Merge Modules Merge modules installation package used to install components which are shared by multiple applications. 下载地址:http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_mergemodules_13_0_1.zip

5、.NET Framework 4的运行时引擎32位和64位操作系统单独安装包: SAP Crystal Reports runtime engine for .NET Framework 4 (32-bit) 32位下载地址:http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_32bit_13_0_1.zip SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit) 64位下载地址:http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_64bit_13_0_1.zip

 

官方下载页面:http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp

 

如果此文档对你有帮助就给我发封感谢信吧,呵呵  Email:jcserver @ 163.com

转载于:https://www.cnblogs.com/qiu18359243869/p/10769043.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
6-1 Create rich reports within the familiarity of your Visual Studio development environment – for free Hit your report development deadlines and come in under budget without leaving Microsoft Visual Studio. Our report design software installs directly into Visual Studio. With this fully functional – and free software, you'll spend less and save time developing rich, interactive reports. Save time using powerful report creation, integration, and delivery tools Deliver interactive, graphical reports on any device through an XML Web services model Distribute highly formatted reports in rich-client Windows environments Enjoy flexible data access with support for over 35 data sources, major browsers and operating systems Extend your application with seamless report integration into WPF applications Seamless upgrade to SAP Crystal Reports 2011 for added report functionality Download SAP Crystal Reports, developer version for Microsoft Visual Studio now › Colleague reviewing a report created with powerful report design software Share Tweet this Share on Facebook Share on LinkedIn Share on Google+ Email 2 Features and Functionality Collapse All Features and Functionality Learn more about the features and functions of SAP Crystal Reports, developer version for Microsoft Visual Studio. Powerful designer features for creating rich reports Flexible Windows and Web application features support development ASP.NET features support your ASP development efforts Broad data access enables multiple sources and dynamic data output Platform features provide support and management for SAP Crystal Reports projects Get all the details on SAP Crystal Reports, developer version for Microsoft Visual Studio features › Less Technical & License Resources Discover if SAP Crystal Reports, developer version for Microsoft Visual Studio is right for you. Get started by reviewing the technical, data access and license details. Access virtually any data sources via ODBC, OLE DB or native connections Licensed for report design, runtime distribution and report viewer distribution Add reporting to thick client and internal server based .NET applications Learn more about data access, licensing and technical requirements › Less Report design options Make the most of the SAP Crystal Reports, developer version for Microsoft Visual Studio runtime by designing your reports in SAP Crystal Reports 2011 software. Utilize Crystal Reports 2011 and spend less time creating and integrating reports Use an editable preview panel and edit reports while viewing them Use RPTR files to protect your report designs from downstream modifications Leverage an object repository for component reuse Utilize a workbench tool to help manage projects Learn more about upgrading to SAP Crystal Reports 2011 › Less Discover Managed BI Extend your existing .NET reporting solutions with SAP Crystal Server for report object, user, and user group management. Utilize APIs for customizing server logon, user management and report scheduling Create data-driven publications, and extend publications with custom processing Add monitoring probes that help ensure the server is behaving as expected Use Web services to perform report scheduling, storing: querying and more Extend your reporting solutions with managed BI – learn more ›

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值