VS2010 打包水晶报表中部署问题详解

32 篇文章 0 订阅
27 篇文章 0 订阅

在vs2010中水晶报表作为一个独立的模块存在,在使用水晶报表前必须安装 使用做个简单的介绍 重点讲解打包水晶报表 因为使用这方面太熟悉不过了 ,从2003 到2005 再到2008 已经使用的太多太多了 。

如下

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

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

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

B.在项目中加一个APP.CONFIG(这是针对WINFORM项目),如果是WEB项目就不用加了,里面有一个WEB.CONFIG;在这配置文件中加上  

<startupuseLegacyV2RuntimeActivationPolicy="true">

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


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


1
SAP Crystal Reports, version for Visual Studio 2010 -
包括了报有DLL的水晶报表文件

2SAP Crystal Reports, version for Visual Studio 2010 -
水晶报表部署时用到的文件

3SAP Crystal Reports runtime engine for .NET Framework 4 (32-bit)

只支持32位系统的包

4SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit)

只支持64位系统的

 

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

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

private void Form1_Load(object sender, EventArgs e)

        {

            SqlConnection con =newSqlConnection("Data Source=127.0.0.1;Initial Catalog=cldz;User ID=sa;Password=888");

            con.Open();

            SqlDataAdapter da =newSqlDataAdapter("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)

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

地址 http://www.microsoft.com/zh-cn/download/details.aspx?id=14431  具体根据你系统个版本 是64的还是32的

把下载的这个补丁也打包进去  如下操作


安装和部署Visual C 2005 SP1运行时刻库



在未安装Visual C++ 2005 的计算机上运行使用 Visual C++ 2005开发的应用程序,必须先安装Visual C++2005 运行时刻库组件。Visual C++ 2005 SP1更新了这个组件,所以使用Visual C++2005 SP1 开发的应用程序必须随程序发布Visual C++ 2005 SP1运行时刻库组件。但是Visual C++ 2005 SP1的一个BUG造成使用安装和部署项目进行部署的时候,安装程序可能安装原版的Visual C++2005 运行时刻库组件,而不是SP1版本,造成使用Visual C++2005 SP1 开发的应用程序启动失败。这个问题的原因是%Program Files%Microsoft Visual Studio8\SDK\v2.0\BootStrapper\Packages\vcredist_x86下面的product.xml中的产品代码在安装Visual C++ 2005 SP1的过程中没有更新。要修正这个问题,可以打开这个文件,修改如下两行

<MsiProductCheck Property="VCRedistInstalled" Product="{A49F249F-0C91-497F-86DF-B2585E8E76B7}"/>

<BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="3"/>

<MsiProductCheck Property="VCRedistInstalled" Product="{7299052b-02a4-4627-81f2-1818da5d550d}"/>

<BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="5"/>


改后的product.xml文件如下

<?xml version="1.0" encoding="utf-8" ?>

<Product
  xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
  ProductCode="Microsoft.Visual.C++.10.0.x86"
>

  <!-- Defines list of files to be copied on build -->
  <PackageFiles>
    <PackageFile Name="vcredist_x86.exe" HomeSite="VCRedistExe"/> <!--补丁-->
     
   
  </PackageFiles>
  <InstallChecks>
    <MsiProductCheck Property="VCRedistInstalled" Product="{7299052b-02a4-4627-81f2-1818da5d550d}"/>


   <!-- <MsiProductCheck Property="VCRedistInstalled" Product="{196BB40D-1578-3D01-B289-BEFC77A11A1E}"/> -->
  </InstallChecks>

  <!-- Defines how to invoke the setup for the Visual C++ 10.0 redist -->
  <!-- TODO: Needs EstrimatedTempSpace, LogFile, and an update of EstimatedDiskSpace -->
  <Commands Reboot="Defer">
    <Command PackageFile="vcredist_x86.exe"
	     Arguments=' /q:a '
	     >

      <!-- These checks determine whether the package is to be installed -->
      <InstallConditions>
        <!-- <BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="3"/>-->

        
        <BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="5"/>

        <!-- Block install if user does not have admin privileges -->
        <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>

        <!-- Block install on Win95 -->
        <FailIf Property="Version9X" Compare="VersionLessThan" Value="4.10" String="InvalidPlatformWin9x"/>

        <!-- Block install on NT 4 or less -->
        <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.00" String="InvalidPlatformWinNT"/>

      </InstallConditions>

      <ExitCodes>
        <ExitCode Value="0" Result="Success"/>
        <ExitCode Value="3010" Result="SuccessReboot"/>
        <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />
      </ExitCodes>

    </Command>
  </Commands>
</Product>


另外,Visual C++ 2005 SP1版本的可以用最新的Visual C++ 2005 SP1运行时刻库组件来替换%Program Files%Microsoft Visual Studio8\SDK\v2.0\BootStrapper\Packages\vcredist_x86下面的vcredist_x86.exe,这样安装和部署项目产生的安装程序中会包含最新版的组件。








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、付费专栏及课程。

余额充值