那要看你用的是什么版本的.net和水晶报表。

解决方案 »

  1.   

    去这里看看,图文并茂,我就是照这他做的。
    http://www.chinabyte.net/20030327/1659638.shtml
      

  2.   

    将与水晶报表关连的dll打入包中,输入水晶报表注册码
      

  3.   

    http://community.csdn.net/Expert/topic/3296/3296776.xml?temp=.1038477How To Deploy Crystal Reports For VS.NET
    Introduction: There are a few components to add to Setup projects for distributing and deploying .NET applications using Crystal Reports for VS.NET. This How to explains all the necessary components and where to get them.
    Requirements 
    · Visual Studio .NET Version 1.0 Deploying Crystal Reports for VS.NET 
    The components needed for deploying are Report Files (.rpt), Merge Modules and the Rutime. This How-to shows you the steps involved in creating reports. So let’s get on with it.
    Report Files (.rpt)
    Report files (.rpt) need to be distributed along with your application. There are two ways in which you can distribute them and it is a matter for the architect of the application. 
    When reports are added to a .NET windows application, they are added by default as an ‘Embedded Resource’. This means that the report will be compiled into the assembly’s manifest and will not be loaded as a separate file. To avoid reports being compiled into the assembly’s manifest as an embedded resource, the way that a report is added needs to be changed. After adding a report to the project (See my sample on GOTDOTNET on how to do it).
    1. Highlight the report in the Solution Explorer window and from the Properties window change the Build Action property from Embedded Resource to None.
    If we don’t embed report files, the report files must be manually added to Setup projects. The advantage being, reports can be easily modified and redeployed without recompiling and redeploying the entire assembly. The disadvantage is that strongly –typed report objects cannot be used in the application.
    The advantage of embedded report files is that you don’t have to deploy report files separately and the users cannot modify them. The disadvantage being, if you modify a report, the entire assembly needs to be recompiled and redeployed.
    This how to limits itself to Embedded Resource Report files
    Merge Modules
    There are four merge modules that need to be included in a setup project to deploy reports.
    Ø Managed.msm
    Ø Database_Access.msm
    Ø Database_Access_enu.msm
    Ø Regwiz.msm
        In addition to these there are two other merge modules that need to be added depending upon the reports. If any of your reports are based on ADO.NET dataset objects (which is like 9 times out of 10!!!). The VC_CRT.msm and VC_STL.msm merge modules also need to be added. All the merge modules are installed to the following folder by default:
    C:\Program Files\Common Files\Merge Modules\By right clicking the Set up projects and choosing Add and then Merge Module...
    We get to the following screen.
     Below you will find what each of the merge module does and its function in deployment of reports.Managed.msm:
    The managed.msm is used to install all the Crystal Reports for VS.NET managed components, such as CrystalDecisions.CrystalReports.Engine.dll, CrystalDecisions.Web.dll and CrystalDecisions.Windows.Forms.dll.Database_Access.msm:
    The database_access.msm is used to install all database drivers the report uses to connect to various types of data sources. This merge module also installs export destination and format drivers, which is used to save a report in different file formats, for e.g. HTML, Excel etc. This merge module is used to install all non managed runtime components for Crystal Reports for VS.NET including charting components.Database_Access_enu.msm:
    The database_access_enu.msm is used to install language specific or localized components. Some of the localized charting and exporting components like PDF are installed by this component. Each language, in which the product is released, will have a specific version of this merge module.Regwiz.msm:
    The regwiz.msm is used to configure registration information on deployed computers and in order to track licensing information. A license key is needed when building with this merge module. This is very important. When this merge module is added to the setup project, it exposes a LicenseKey Property that must be set before building the project. You can find this property by first highlighting the merge module in the Solution Explorer and in the Properties pane under MergeModuleProperties. The license key would have been emailed to you when you register the product. This key is also available from the VS.NET Help|About … dialog, under the installed products list.If the license key is not set, an error will occur when building the project and if the setup is installed on a target machine, without specifying the license key, various “Keycodev2.dll” errors will occur. VC_CRT.msm & VC_STL.msm:
    These two merge modules are required because the database driver crdb_adoplus.dll is dependent on files installed by these merge modules.
    When these modules are added, there is a MergeModuleProperties property which is set to Default. Click the drop down list to select a different folder from default. Select the Browse option to list folders available on the target machine. A system folder needs to be added before you can set this as the new target folder.
    Runtime
    Since Crystal Reports for VS.NET is based on the .NET Framework, the framework must also be distributed or installed on the target machine. The dotnetfx.exe needs to be run on the target machine. You can get more information on redistributing the .NET Framework at this URL
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/dotnetfxref.asp
    Troubleshooting Next Steps
    Happy programming!!
    References
    For further Information refer to these sites:
    http://suppport.crystaldecisions.com/kbase and search for knowledge base articles: c2010681 and c2011205 for Keycodev2.dll errors
    www.crystaldecisions.com
      

  4.   

    http://www.chinabyte.net/20030327/1659638.shtml
      

  5.   

    除了必要的库文件外,还要添加合并模块,并添加文件,选择一些msm文件具体要看到你要用哪些东西
      

  6.   

    其实主要是把那几个merge module加上, 然后在一个教regwiz* 的属性里把 注册码添上。
      

  7.   

    水晶報表打包的具体操作步骤:1)新建“安装和部署项目”-->“安装向导”2)选择项目类型(这里选“创建用于windows应用程序的安装程序”)-->下一步3)选择要包含的文件:添加你的程序文件 + C:\Program Files\Common Files\Merge Modules下的managed.msm、managed_chs.msm、database_access.msm、database_access_chs.msm、regwiz.msm、VC_CRT.msm、VC_STL.msm。-->完成
    具体功能如下:managed.msm、managed_chs.msm、(托管组件 MSM 处理所有托管组件的分发,其中包括 Windows 窗体查看器、Web 窗体查看器和所有 Crystal Decisions 命名空间)database_access.msm、database_access_chs.msm、(对于使报表运行所需的所有其他文件,由数据库访问 MSM 处理其分发。其中包括数据库、导出和图表驱动程序。)regwiz.msm、(KeyCode MSM 处理 Crystal Decisions 密钥号码的安装)VC_CRT.msm、VC_STL.msm(这个在msdn上绝对没提起,是vc的运行库,估计是Crystal Report或涉及到的某些程序是用vc写的,所以需要它!)4)打开解决方案-->右键点击regwiz.msm的属性,在“MergeMouduleProperties”里的“License Key”填入:AAP5GKS0000GDE100DS(这个是你生成Crystal Report是用到的注册号的密码!)5)生成解决方案(或直接按Ctrl+Shift+B)至此CrystalReport的整个分发程序已经做好,所要做的是先在Win98装上dotNetFramework和MDAC27(在更新盘里有),再把刚才做的那个安装程序双击一下……