精谈“VS2010中水晶报表应用及实例”分享

98 篇文章 0 订阅
27 篇文章 0 订阅

声明一下,我只是为了研究VS2010中的报表部分
基本分类如下:
第一部分:VS2010简介
VS2010是微软的提供的一套完整的开发环境,功能也是相当的大
微软宣布了下一代开发工具和平台的正式名称,分别称为“Visual Studio Team System 2010”和“.NET Framework 4.0”,很显然二者会在2010年发布。

VSTS 2010开发代号“Rosario”(阿根廷港市罗萨里奥),将致力于引领下一代平台发展、提高开发人员的工作效率和热情、创建突破性应用程序、推动云计算等新兴趋势、合理化应用程序生命周期管理(ALM)。

VSTS 2010将支持统一建模语言(UML)和特定域语言(DSL),可为各类开发人员提供合适的工具,而这也是微软更大模型平台的一部分,“Oslo”技术也是它的一部分。
第二部分:报表功能“水晶报表”
1)SAP Crystal Reports, version for Visual Studio 2010 - 
http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0.exe
包括了报有DLL的水晶报表文件

2)SAP Crystal Reports, version for Visual Studio 2010 - 
http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_mergemodules_13_0.zip
水晶报表部署时用到的文件

3)SAP Crystal Reports runtime engine for .NET Framework 4 (32-bit)
http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_32bit_13_0.zip
只支持32位系统的包

4)SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit)
http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_64bit_13_0.zip
只支持64位系统的


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

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

private void Form1_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=cldz;User ID=sa;Password=888");

            con.Open();

            SqlDataAdapter da = new SqlDataAdapter("select top 100 * from table", 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位的下载上面的3);如果是64位的下载上面的4);

二,就是下载上面2)中的MSM文件,里面第一个是CRRuntime_13_0.msm这个是英文包;如果需要支持中文就加一个MSM,( CRRuntime_13_0_zh_cn.msm); 另外加一个CRRuntime_13_0_maps.msm 这个可以不用;

用VS2010自带的打包软件打包发布,新建一个安装项目,安装项目的制作过程这里就不详细说了,跟以前的制过程一样; 制作完后,右键项目选添加―――合并模块――把上面提到的三个以.MSM结尾的文件加入进去,并且把

C:/Program Files/Common Files/Merge Modules文件夹中的VC100的MSM加入进去,如果是32位的就加X86的,如果是64位的就加X64的;最后确定;

再右键项目选属性,点击“系统必备”按钮;在弹出的对话框中选中 VISUAL C++ 2010 运行库,注意根据系统选,有32与64位的;

在下面的单选按钮中选第二项“从与我的应用程序相同的位置下载系统必备组件”;

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

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

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



这个报表的相关控件

发个图让你们上上眼

CrystalReport for vs2010 水晶报表安装方式如下:
1、在你的开发环境中找到Visual Studio安装目录下的"SDK"v2.0"BootStrapper"Packages"CrystalReports,将安装文件CRRedist2010_x86.msi,复制到服务器中并安装。

2、如果程序还不能运行,需要将水晶报表的五个dll文件复制到你的网站下的bin目录,其五大将的名称如下:

     CrystalDecisions.CrystalReports.Engine.dll

     CrystalDecisions.ReportSource.dll

     CrystalDecisions.Shared.dll

     CrystalDecisions.Web.dll

     CrystalDecisions.Windows.Forms.dll


VS2008中是集成水晶报表的
我讲的VS2010中没有集成水晶报表必须下载插件即可


我现在也在分析一个问题时出现一个问题
1)C#中的水晶报表是编译时也包含在EXE中
2)DELPHI那样用RReports315cn第三方控件时的这个报表工具生成
的报表文件:UserLog.fr3,是在使用时才加载进行的呀???
这样DELPHI中的报表文件UserLog.fr3在一定的情况下能可以升级的,
3)C#这个方面如何处理呀????


我现在还是有一个问题:
DELPHI中编写实现报表功能,就是报表的文件是单独的uusss.fr3
这样根据情况可能修改那个报表文件即可;
但是C#中的报表文件是编译到EXE文件,要是‘升级’的话就必须再
将EXE也重新编译一下
有没有好的方法处理这个问题呢?????
就是说主程序EXE和报表文件rpt最好是分离的


转自:http://bbs.csdn.net/topics/370193412

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 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、付费专栏及课程。

余额充值