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

.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.msmdotnetcrystalreports.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"]); 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
Crystal Reports 9.2 中文版(水晶报表) 下载,,软件版本:9.2.0.448不过现已出了Crystal Reports Professional v9.2.2.634 (c) Crystal Decisions,有足够的空间就提供.这是一个很不错的报表控件,我相信很多朋友都听说过吧!Crystal Reports 用于处理数据库,帮助用户分析和解释重要信息。使用 Crystal Reports 可以方便地创建简单报表,同时它也提供了创建复杂或专用的报表所需的整套工具。 创建所能想象的任何报表 Crystal Reports几乎可以从任何数据源生成您需要的报表。内置报表专家在您生成报表和完成一般的报表任务过程中,会一步一步地指导您进行操作。报表专家通过公式、交叉表、子报表和设置条件格式帮助表现数据的实际意义,揭示可能被隐藏掉的重要关系。如果文字和数字确实不够充分,则用地理地图和图形进行形象的信息交流。 将报表扩展到 Web Crystal Reports 的灵活性并未停留在创建报表这一功能上 ?您可以用各种各样的格式发布报表,包括用 Microsoft 的 Word 和 Excel 发布、通过电子邮件甚至 Web 发布。高级的 Web 报表功能允许工作组中的其他成员在他们自己的 Web 浏览器中查看或更新共享报表。 将报表并入应用程序通过将 Crystal Reports 的报表处理功能整合到自己的数据库应用程序中,应用程序和 Web 开发人员可以节省开发时间并满足用户的需求。Crystal Reports 支持大多数流行的开发语言,可以方便地在任何应用程序中添加报表。 不论您是 IT 行业的站点管理员,还是营销推广经理,也无论您是金融业的数据库管理员还是 CEO,Crystal Reports 都堪称是一个功能强大的工具,它可以帮助每一个人分析、解释重要信息。感谢 revenant 上传!
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值