.net打包真的很麻烦,特别是碰到要用水晶报表,那打包就更加复杂了。

如果你想在“干净”的机器上成功安装和使用水晶报表,请按照下列步骤:

1)新建“安装和部署项目”-->“安装向导”
(2)选择项目类型(这里选“创建用于windows应用程序的安装程序”)-->下一步
(3)选择要包含的文件:要部署使用 Crystal Reports for Visual Studio .NET 2003 的程序,需要添加合并模块(在解决方案资源管理器中tree的顶端节点右键-->添加).
Crystal_Database_Access2003.msm
Crystal_Database_Access2003_enu.msm
Crystal_Managed2003.msm
Crystal_regwiz2003.msm
VC_User_CRT71_RTL_X86_---.msm
VC_User_STL71_RTL_X86_---.msm
你可以 'C:\Program Files\Common Files\Merge Modules' 文件夹下找到替换的合并模块。
(4)打开解决方案-->右键点击Crystal_regwiz2003.msm 的属性,在“MergeMouduleProperties”里的“License Key”填入:***************************(这个是你生成Crystal Report是用到的注册号的密码!)
(5)生成解决方案

如果没有第四步,会产生在执行打印报表时提示keycodev2.dll或者无效密码的错误。

以上的步骤,如果你的“干净”的机器上装有水晶报表,那么到这里完全就可以了。

如果你不希望在“干净”的机器上装水晶报表,继续以下的步骤:

  1. 在“添加项目输出组”中,选择“主输出”,然后单击“确定”。

将自动添加所有依赖项,如 dotnetfxredist_x86_enu.msm和dotnetcrystalreports.msm。

2.需要将dotnetcrystalreports.msm排除在项目之外,在解决方案资源管理器中右击这个模块的右键,选择“排除”。

3.在解决方案资源管理器中,右击安装项目,指向“添加”,然后单击“合并模块”。

4.在“添加模块”对话框中,选择下列要添加到安装项目的合并模块,然后单击“打开”:

  • reportengine.msm,
  • crnetruntime.msm
  • license.msm
  • mapping.msm (可选,当在报表中使用了geographic maps时)

5.在解决方案资源管理器中,右击 license.msm 文件,然后选择“属性”。

6.在“属性”窗口中,展开 MergeModuleProperties,然后在“许可证密钥”属性框中输入一个有效的许可证密钥。

注意 :  每当部署 Crystal Reports 应用程序时,必须提供许可证密钥。

7.从“生成”菜单中,选择“生成解决方案”以生成应用程序

如果以上步骤没有的化,会提示“load crpe32.dll failed”的错误。

用到的模块下载地址:  http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9netmergemodules_chs.zip.asp

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9netredist_chs.zip.asp

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9rdcmergemodules_chs.zip.asp

如果你的机器上装的是windows 98,不继续以下的步骤会产生"Load Report Failed" (CRQE.dll)的错误。
报表在部分Win98的客户端可以载入,在部分Win98的客户端载入报表时却提示"Load Report Failed"是因为水晶报表运行时所需的 CRQE.dll 在客户端的系统注册不正确,而原因又是ATL.dll 的版本不对(Windows 98/ME下的正确版本号应为3.0.8449)。
解决办法有两条:
1.在客户端安装 IE6.0,难怪有的客户端运行正常。
2.将 ATL.msm 模块添加到安装工程,ATL.msm 是 Visual Studio installer 1.1 的一部分,可以去微软的网站http://msdn.microsoft.com/vstudio/downloads/tools/vsi11/download.aspx下载, 添加办法同上。

至此,可以说打包基本完成。不过还要注意:

如果你用的是水晶报表的推模式,一般不用设置登陆信息,但是要这样写:obj.SetDataSource(this.ds.Tables["tablename"]);如果你写成了obj.SetDataSource(this.ds)就会有登陆框的。

如果你用的是水晶报表的拉模式,你就一定要写上登陆信息:

crReportDocument = new OracleReport();

//Set the crConnectionInfo with the current values stored in the report
   crConnectionInfo = crReportDocument.Database.Tables[0].LogOnInfo.ConnectionInfo;

/* Populate the ConnectionInfo Objects Properties with the appropriate values for
   the ServerName, User ID, Password and DatabaseName. However, since Oracle
   works on Schemas, Crystal Reports does not recognize or store a DatabaseName.
   Therefore, the DatabaseName property must be set to a BLANK string. */
   crConnectionInfo.DatabaseName = "";
   crConnectionInfo.ServerName = "Your Server Name";
   crConnectionInfo.UserID = "Your User ID";
   crConnectionInfo.Password = "Your Password";

//Set the CrDatabase Object to the Report's Database
   crDatabase = crReportDocument.Database;

//Set the CrTables object to the Tables collection of the Report's dDtabase
   crTables = crDatabase.Tables;

//Loop through each Table object in the Tables collection and apply the logon info
   //specified ealier. Note this sample only has one table so the loop will only execute once
   foreach (Table crTable in crTables)
   {
    crTableLogOnInfo = crTable.LogOnInfo;
    crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
    crTable.ApplyLogOnInfo (crTableLogOnInfo);

// if you wish to change the schema name as well, you will need to set Location property as follows:
    // crTable.Location = "<new schema name>." + crTable.Name;
   }

//Set the ReportSource of the CrystalReportViewer to the strongly typed Report included in the project
   crystalReportViewer1.ReportSource = crReportDocument;

还有一点要注意:
如果你用到了子报表,一定要处理:

//Go through each sections in the main report and identify the subreport by name
   crSections = crReportDocument.ReportDefinition.Sections;

foreach(Section crSection in crSections)
   {
    crReportObjects = crSection.ReportObjects;
    //loop through all the report objects to find all the subreports
    foreach(ReportObject crReportObject in crReportObjects)
    {
     if (crReportObject.Kind == ReportObjectKind.SubreportObject)
     {
      //you will need to typecast the reportobject to a subreport
      //object once you find it
      crSubreportObject = (SubreportObject)crReportObject;

//open the subreport object
      crSubReportDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
      //Once the correct subreport has been located pass it the
      //appropriate dataset
      if(crSubReportDoc.Name == "FirstSub")
      {
       //crSubReportDoc.Database.Tables[0].SetDataSource(ds);
       crSubReportDoc.SetDataSource(ds);
      }
     }
    }
   }
   crystalReportViewer1.ReportSource = crReportDocument;

同样crSubReportDoc.SetDataSource(ds);改为:crSubReportDoc.SetDataSource(ds.Tables["tablename"]);

6.在“属性”窗口中,展开 MergeModuleProperties,然后在“许可证密钥”属性框中输入一个有效的许可证密钥。

注意 :  每当部署 Crystal Reports 应用程序时,必须提供许可证密钥。

7.从“生成”菜单中,选择“生成解决方案”以生成应用程序

如果以上步骤没有的化,会提示“load crpe32.dll failed”的错误。

用到的模块下载地址:  http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9netmergemodules_chs.zip.asp

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9netredist_chs.zip.asp

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9rdcmergemodules_chs.zip.asp

如果你的机器上装的是windows 98,不继续以下的步骤会产生"Load Report Failed" (CRQE.dll)的错误。
报表在部分Win98的客户端可以载入,在部分Win98的客户端载入报表时却提示"Load Report Failed"是因为水晶报表运行时所需的 CRQE.dll 在客户端的系统注册不正确,而原因又是ATL.dll 的版本不对(Windows 98/ME下的正确版本号应为3.0.8449)。
解决办法有两条:
1.在客户端安装 IE6.0,难怪有的客户端运行正常。
2.将 ATL.msm 模块添加到安装工程,ATL.msm 是 Visual Studio installer 1.1 的一部分,可以去微软的网站http://msdn.microsoft.com/vstudio/downloads/tools/vsi11/download.aspx下载, 添加办法同上。

至此,可以说打包基本完成。不过还要注意:

如果你用的是水晶报表的推模式,一般不用设置登陆信息,但是要这样写:obj.SetDataSource(this.ds.Tables["tablename"]);如果你写成了obj.SetDataSource(this.ds)就会有登陆框的。

如果你用的是水晶报表的拉模式,你就一定要写上登陆信息:

crReportDocument = new OracleReport();

//Set the crConnectionInfo with the current values stored in the report
   crConnectionInfo = crReportDocument.Database.Tables[0].LogOnInfo.ConnectionInfo;

/* Populate the ConnectionInfo Objects Properties with the appropriate values for
   the ServerName, User ID, Password and DatabaseName. However, since Oracle
   works on Schemas, Crystal Reports does not recognize or store a DatabaseName.
   Therefore, the DatabaseName property must be set to a BLANK string. */
   crConnectionInfo.DatabaseName = "";
   crConnectionInfo.ServerName = "Your Server Name";
   crConnectionInfo.UserID = "Your User ID";
   crConnectionInfo.Password = "Your Password";

//Set the CrDatabase Object to the Report's Database
   crDatabase = crReportDocument.Database;

//Set the CrTables object to the Tables collection of the Report's dDtabase
   crTables = crDatabase.Tables;

//Loop through each Table object in the Tables collection and apply the logon info
   //specified ealier. Note this sample only has one table so the loop will only execute once
   foreach (Table crTable in crTables)
   {
    crTableLogOnInfo = crTable.LogOnInfo;
    crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
    crTable.ApplyLogOnInfo (crTableLogOnInfo);

// if you wish to change the schema name as well, you will need to set Location property as follows:
    // crTable.Location = "<new schema name>." + crTable.Name;
   }

//Set the ReportSource of the CrystalReportViewer to the strongly typed Report included in the project
   crystalReportViewer1.ReportSource = crReportDocument;

还有一点要注意:
如果你用到了子报表,一定要处理:

//Go through each sections in the main report and identify the subreport by name
   crSections = crReportDocument.ReportDefinition.Sections;

foreach(Section crSection in crSections)
   {
    crReportObjects = crSection.ReportObjects;
    //loop through all the report objects to find all the subreports
    foreach(ReportObject crReportObject in crReportObjects)
    {
     if (crReportObject.Kind == ReportObjectKind.SubreportObject)
     {
      //you will need to typecast the reportobject to a subreport
      //object once you find it
      crSubreportObject = (SubreportObject)crReportObject;

//open the subreport object
      crSubReportDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
      //Once the correct subreport has been located pass it the
      //appropriate dataset
      if(crSubReportDoc.Name == "FirstSub")
      {
       //crSubReportDoc.Database.Tables[0].SetDataSource(ds);
       crSubReportDoc.SetDataSource(ds);
      }
     }
    }
   }
   crystalReportViewer1.ReportSource = crReportDocument;

同样crSubReportDoc.SetDataSource(ds);改为:crSubReportDoc.SetDataSource(ds.Tables["tablename"]);

6.在“属性”窗口中,展开 MergeModuleProperties,然后在“许可证密钥”属性框中输入一个有效的许可证密钥。

注意 :  每当部署 Crystal Reports 应用程序时,必须提供许可证密钥。

7.从“生成”菜单中,选择“生成解决方案”以生成应用程序

如果以上步骤没有的化,会提示“load crpe32.dll failed”的错误。

用到的模块下载地址:  http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9netmergemodules_chs.zip.asp

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9netredist_chs.zip.asp

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9rdcmergemodules_chs.zip.asp

如果你的机器上装的是windows 98,不继续以下的步骤会产生"Load Report Failed" (CRQE.dll)的错误。
报表在部分Win98的客户端可以载入,在部分Win98的客户端载入报表时却提示"Load Report Failed"是因为水晶报表运行时所需的 CRQE.dll 在客户端的系统注册不正确,而原因又是ATL.dll 的版本不对(Windows 98/ME下的正确版本号应为3.0.8449)。
解决办法有两条:
1.在客户端安装 IE6.0,难怪有的客户端运行正常。
2.将 ATL.msm 模块添加到安装工程,ATL.msm 是 Visual Studio installer 1.1 的一部分,可以去微软的网站http://msdn.microsoft.com/vstudio/downloads/tools/vsi11/download.aspx下载, 添加办法同上。

至此,可以说打包基本完成。不过还要注意:

如果你用的是水晶报表的推模式,一般不用设置登陆信息,但是要这样写:obj.SetDataSource(this.ds.Tables["tablename"]);如果你写成了obj.SetDataSource(this.ds)就会有登陆框的。

如果你用的是水晶报表的拉模式,你就一定要写上登陆信息:

crReportDocument = new OracleReport();

//Set the crConnectionInfo with the current values stored in the report
   crConnectionInfo = crReportDocument.Database.Tables[0].LogOnInfo.ConnectionInfo;

/* Populate the ConnectionInfo Objects Properties with the appropriate values for
   the ServerName, User ID, Password and DatabaseName. However, since Oracle
   works on Schemas, Crystal Reports does not recognize or store a DatabaseName.
   Therefore, the DatabaseName property must be set to a BLANK string. */
   crConnectionInfo.DatabaseName = "";
   crConnectionInfo.ServerName = "Your Server Name";
   crConnectionInfo.UserID = "Your User ID";
   crConnectionInfo.Password = "Your Password";

//Set the CrDatabase Object to the Report's Database
   crDatabase = crReportDocument.Database;

//Set the CrTables object to the Tables collection of the Report's dDtabase
   crTables = crDatabase.Tables;

//Loop through each Table object in the Tables collection and apply the logon info
   //specified ealier. Note this sample only has one table so the loop will only execute once
   foreach (Table crTable in crTables)
   {
    crTableLogOnInfo = crTable.LogOnInfo;
    crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
    crTable.ApplyLogOnInfo (crTableLogOnInfo);

// if you wish to change the schema name as well, you will need to set Location property as follows:
    // crTable.Location = "<new schema name>." + crTable.Name;
   }

//Set the ReportSource of the CrystalReportViewer to the strongly typed Report included in the project
   crystalReportViewer1.ReportSource = crReportDocument;

还有一点要注意:
如果你用到了子报表,一定要处理:

//Go through each sections in the main report and identify the subreport by name
   crSections = crReportDocument.ReportDefinition.Sections;

foreach(Section crSection in crSections)
   {
    crReportObjects = crSection.ReportObjects;
    //loop through all the report objects to find all the subreports
    foreach(ReportObject crReportObject in crReportObjects)
    {
     if (crReportObject.Kind == ReportObjectKind.SubreportObject)
     {
      //you will need to typecast the reportobject to a subreport
      //object once you find it
      crSubreportObject = (SubreportObject)crReportObject;

//open the subreport object
      crSubReportDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
      //Once the correct subreport has been located pass it the
      //appropriate dataset
      if(crSubReportDoc.Name == "FirstSub")
      {
       //crSubReportDoc.Database.Tables[0].SetDataSource(ds);
       crSubReportDoc.SetDataSource(ds);
      }
     }
    }
   }
   crystalReportViewer1.ReportSource = crReportDocument;

同样crSubReportDoc.SetDataSource(ds);改为:crSubReportDoc.SetDataSource(ds.Tables["tablename"]);

6.在“属性”窗口中,展开 MergeModuleProperties,然后在“许可证密钥”属性框中输入一个有效的许可证密钥。

注意 :  每当部署 Crystal Reports 应用程序时,必须提供许可证密钥。

7.从“生成”菜单中,选择“生成解决方案”以生成应用程序

如果以上步骤没有的化,会提示“load crpe32.dll failed”的错误。

用到的模块下载地址:

如果你的机器上装的是windows 98,不继续以下的步骤会产生"Load Report Failed" (CRQE.dll)的错误。
报表在部分Win98的客户端可以载入,在部分Win98的客户端载入报表时却提示"Load Report Failed"是因为水晶报表运行时所需的 CRQE.dll 在客户端的系统注册不正确,而原因又是ATL.dll 的版本不对(Windows 98/ME下的正确版本号应为3.0.8449)。
解决办法有两条:
1.在客户端安装 IE6.0,难怪有的客户端运行正常。
2.将 ATL.msm 模块添加到安装工程,ATL.msm 是 Visual Studio installer 1.1 的一部分,可以去微软的网站http://msdn.microsoft.com/vstudio/downloads/tools/vsi11/download.aspx下载, 添加办法同上。

至此,可以说打包基本完成。不过还要注意:

如果你用的是水晶报表的推模式,一般不用设置登陆信息,但是要这样写:obj.SetDataSource(this.ds.Tables["tablename"]);如果你写成了obj.SetDataSource(this.ds)就会有登陆框的。

如果你用的是水晶报表的拉模式,你就一定要写上登陆信息:

crReportDocument = new OracleReport();

//Set the crConnectionInfo with the current values stored in the report
   crConnectionInfo = crReportDocument.Database.Tables[0].LogOnInfo.ConnectionInfo;

/* Populate the ConnectionInfo Objects Properties with the appropriate values for
   the ServerName, User ID, Password and DatabaseName. However, since Oracle
   works on Schemas, Crystal Reports does not recognize or store a DatabaseName.
   Therefore, the DatabaseName property must be set to a BLANK string. */
   crConnectionInfo.DatabaseName = "";
   crConnectionInfo.ServerName = "Your Server Name";
   crConnectionInfo.UserID = "Your User ID";
   crConnectionInfo.Password = "Your Password";

//Set the CrDatabase Object to the Report's Database
   crDatabase = crReportDocument.Database;

//Set the CrTables object to the Tables collection of the Report's dDtabase
   crTables = crDatabase.Tables;

//Loop through each Table object in the Tables collection and apply the logon info
   //specified ealier. Note this sample only has one table so the loop will only execute once
   foreach (Table crTable in crTables)
   {
    crTableLogOnInfo = crTable.LogOnInfo;
    crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
    crTable.ApplyLogOnInfo (crTableLogOnInfo);

// if you wish to change the schema name as well, you will need to set Location property as follows:
    // crTable.Location = "<new schema name>." + crTable.Name;
   }

//Set the ReportSource of the CrystalReportViewer to the strongly typed Report included in the project
   crystalReportViewer1.ReportSource = crReportDocument;

还有一点要注意:
如果你用到了子报表,一定要处理:

//Go through each sections in the main report and identify the subreport by name
   crSections = crReportDocument.ReportDefinition.Sections;

foreach(Section crSection in crSections)
   {
    crReportObjects = crSection.ReportObjects;
    //loop through all the report objects to find all the subreports
    foreach(ReportObject crReportObject in crReportObjects)
    {
     if (crReportObject.Kind == ReportObjectKind.SubreportObject)
     {
      //you will need to typecast the reportobject to a subreport
      //object once you find it
      crSubreportObject = (SubreportObject)crReportObject;

//open the subreport object
      crSubReportDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
      //Once the correct subreport has been located pass it the
      //appropriate dataset
      if(crSubReportDoc.Name == "FirstSub")
      {
       //crSubReportDoc.Database.Tables[0].SetDataSource(ds);
       crSubReportDoc.SetDataSource(ds);
      }
     }
    }
   }
   crystalReportViewer1.ReportSource = crReportDocument;

同样crSubReportDoc.SetDataSource(ds);改为:crSubReportDoc.SetDataSource(ds.Tables["tablename"]);

转载于:https://www.cnblogs.com/yan0837/archive/2005/09/13/235957.html

关于水晶报表打包的一些注意的地方!相关推荐

  1. 水晶报表10高级开发版下载及序列号

    水晶报表10高级开发版下载及序列号 分类: 编程语言 2011-04-28 22:24 526人阅读 评论(0) 收藏 举报 Crystal Reports 10 Advanced Developer ...

  2. 用InstallShield9打包 vb6+水晶报表中文版9.2 [转]

    转自http://www.594zz.com/info/35617.html   这些天碰到一个项目,需要将vb6+水晶报表中文版9.2 环境打包,在网上查了不少资料,很多网友也在问这个问题.虽然借鉴 ...

  3. INSTALLSHIELD11.5中打包水晶报表的问题,ScriptProject与ScriiptMSIProject差异引起的错误!...

    INSTALLSHIELD11.5中打包水晶报表的问题,ScriptProject与ScriiptMSIProject差异引起的错误! 使用ScriptMSIProject打包.NET程序后,部署的时 ...

  4. 水晶报表乱码中文乱码问题(收藏)

    水晶报表乱码中文乱码问题 - Crystal reports 原因1:CR輸出的漢字格式不对(簡體還是繁體),簡體要先在區域設成(中國),然後在cr裡設字體為"宋體"即可 原因2: ...

  5. [转]VS2010中水晶报表安装应用及实例

    基本分类如下: 第一部分:VS2010简介 VS2010是微软的提供的一套完整的开发环境,功能也是相当的大 微软宣布了下一代开发工具和平台的正式名称,分别称为"Visual Studio T ...

  6. 水晶报表工具栏出现红叉叉无法打印导出等问题的解决方法

    常见场景: 使用WebForm方式开发水晶报表应用,在本机调试一切正常.但是发布到服务器上以后,报表可以正确显示. 但是工具栏上的图标却成了红叉叉,无法执行打印.导出操作,页面提示有脚本错误. 解决方 ...

  7. VS2008水晶报表发布部署总结

    如果你安装了VS2008,那么可以找到如下目录: C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\Crystal ...

  8. Asp.net2.0水晶报表的一些示例源码

    最近关注了一下Asp.net2.0中水晶报表的资料,发现示例少之又少(怀疑是水晶报表免费的比较少的缘故),搜集到了Asp.net官方的许多示例源码,试了几个还不错,这里发给大家分享一下(我仅把Asp. ...

  9. VS2010中水晶报表安装应用及实例

    基本分类如下: 第一部分:VS2010简介 VS2010是微软的提供的一套完整的开发环境,功能也是相当的大 微软宣布了下一代开发工具和平台的正式名称,分别称为"Visual Studio T ...

  10. 水晶报表 发布 部署

    <script src="http://www.shengfang.org/blog/blog/template/clean/function.js" type=" ...

最新文章

  1. Eclipse Class Decompiler---Java反编译插件
  2. cocos2d-x 消类游戏,类似Diamond dash 设计
  3. 循环神经网络 递归神经网络_了解递归神经网络中的注意力
  4. Codeforces 刷题记录(已停更)
  5. logback利用mdc机制为日志增加traceId
  6. 《大侦探皮卡丘》天龙八部在路上
  7. 中流-接入Camunda流程引擎
  8. cinemachine 相机跟踪物体
  9. c语言在屏幕上输出一个菱形图案,C语言 在屏幕上输出菱形图案
  10. 2018全球机器学习技术大会议程抢鲜看!
  11. win10触控平板 如何禁掉IE10的手势控制
  12. 《仿真使用ARENA软件》
  13. 无人值守安装linux7,PXE下无人值守配置阵列及安装CentOS7
  14. 爱情要不要吃回头草?(林忆)
  15. java毕业设计汽车售后服务管理系统mybatis+源码+调试部署+系统+数据库+lw
  16. G003-181-19
  17. access to同义替换_雅思写作常用近义同义词替换表64415
  18. 上海交通大学能源动力(核能与核技术工程)考研上岸前辈备考经验
  19. LDA初探,希拉里邮件主题提取
  20. 物联网 + 区块链系列(一):物联网面临的挑战

热门文章

  1. Outlook中的Notes的链接打不开,提示错误信息“File does not exit”
  2. Vim 的几个彩蛋。。
  3. Mac---使用tree生成目录结构
  4. textfield设置一键删除
  5. Xcode 8 Swift 类似插件方法
  6. erlang的timer定时器浅析
  7. Croc Champ 2013 - Round 1 E. Copying Data(线段树)
  8. Exception in thread main java.lang.NoClassDefFoundError: scala/Product$class
  9. [转载] Dubbo架构设计详解
  10. Implement Trie (Prefix Tree)