1.

            Try
Dim rptDoc As New CrystalDecisions.CrystalReports.Engine.ReportClass()
Dim rptView As New CrystalDecisions.Windows.Forms.CrystalReportViewer()
Catch ex As Exception
If (System.IntPtr.Size = ) Then
Dim ehp As BLL2.ExecutorHelper = New BLL2.ExecutorHelper()
Dim path As String = ehp.Download2UnZipRpt()
BLL2.ExecutorHelper.ExecuteAsAdmin(path)
Else
' leave the work for 32bit os to develop in the future
End If End Try

2. more information

when you initialize a ReportDocument on a system without a crystal report runtime, it will thrown an error:

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient, or the Crystal Reports runtime is not installed correctly. Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information.
at CrystalDecisions.CrystalReports.Engine.ReportDocument.CheckForCrystalReportsRuntime()
at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
--- End of inner exception stack trace ---
at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
at GermanSchool.InvoiceReportForm.InvoiceReportForm_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

// CrystalDecisions.CrystalReports.Engine.ReportDocument
private static void CheckForCrystalReportsRuntime()
{
string pathList = Registry.LocalMachine + "\\" + ReportDocument.CR_REGKEY;
RegistryPermission registryPermission = new RegistryPermission(RegistryPermissionAccess.Read, pathList);
registryPermission.Assert();
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(ReportDocument.CR_REGKEY);
if (registryKey == null)
{
string @string = CREngineRes.GetString("IDS_ERROR_CR_RUNTIME_NOT_INSTALLED");
ReportDocument.LogSCRException(@string, );
if (SystemInformation.UserInteractive)
{
MessageBox.Show(@string, CREngineRes.GetString("IDS_EVENTLOG_SOURCE"));
}
throw new LoadSaveReportException(@string, EngineExceptionErrorID.LoadingReportFailed);
}
}

check whether the crystal report runtime is exists 检查crystalreport运行时是否存在的更多相关文章

  1. RTTI (Run-Time Type Identification,通过运行时类型识别) 转

    参考一: RTTI(Run-Time Type Identification,通过运行时类型识别)程序能够使用基类的指针或引用来检查这些指针或引用所指的对象的实际派生类型.   RTTI提供了以下两个 ...

  2. Using Run-Time Dynamic Linking(使用运行时动态链接库)

    // A simple program that uses LoadLibrary and // GetProcAddress to access myPuts from Myputs.dll. #i ...

  3. 运行时环境(The Runtime Environment)

    App Engine应用响应网络请求.当一个客户端(典型的是用户的Web浏览器)使用HTTP请求(比如获取在URL上的网页)连接上应用的时候,网络请求就开始了.当App Engine接收到请求时,它会 ...

  4. [转帖]运行时库(runtime library)

    运行时库(runtime library) https://blog.csdn.net/xitie8523/article/details/82712105 没学过这些东西 或者当时上课没听 又或者 ...

  5. Crystal Report Error: Either the Crystal Reports registy key permission are insufficient or the Crystal Reports runtime is not installed correctly

    在64位 Windows 7中水晶报表的错误: Crystal Report Error: Either the Crystal Reports registy key permission are ...

  6. Visual Studio 2017 集成Crystal Report为ASP.NET MVC呈现报表

    最近项目需要实现报表功能,平衡各方面的因素,还是使用Crystal Report(水晶报表) 下载较新版本: http://downloads.businessobjects.com/akdlm/cr ...

  7. 2.ASP.NET MVC 中使用Crystal Report水晶报表

    上一篇,介绍了怎么导出Excel文件,这篇文章介绍在ASP.NET MVC中使用水晶报表. 项目源码下载:https://github.com/caofangsheng93/CrystalReport ...

  8. 解决Crystal Report XI R2不能在64操作系统正常工作的问题-web程序

    原文:[原创]解决Crystal Report XI R2不能在64操作系统正常工作的问题-web程序 我更换了新的电脑,操作系统也从原来32位的windows 2003 R2升级到windows 2 ...

  9. Crystal Report 在 VS 2010 中的使用和发布

    原文:Crystal Report 在 VS 2010 中的使用和发布 使用: 打开CrystalReport官网下载页 目前最新版本为13.0.4 选择“SAP Crystal Reports, v ...

随机推荐

  1. Ⅳspring的点点滴滴--方法和事件

    承接上文 方法和事件 .net篇(环境为vs2012+Spring.Core.dll v1.31) public abstract class MethodDemo { protected abstr ...

  2. Kali安全测试相关书籍

    Kali安全测试相关书籍http://www.automationqa.com/forum.php?mod=viewthread&tid=4052&fromuid=2

  3. Singleton(单例模式)

    类的实例化次数只能一次. 例如:小王和小李通过门铃进行沟通,首先判断小王家是否有门,若没有建立门,若有门直接返回门. var xiaowang = (function(argument){ var m ...

  4. js 刷新页面自动回到顶部

    <script type="application/x-javascript"> addEventListener("load", function ...

  5. 2 WPF之XMAL----XMAL概览

    转载:http://blog.csdn.net/fwj380891124/article/details/8085458 微软为了把开发模式从网络开发移植到桌面开发和富媒体网络程序的开发上,微软创造了 ...

  6. 20160505-hibernate入门2

    基本概念和CURD 开发流程 1由Domain object -> mapping->db.(官方推荐) 2由DB开始,用工具生成mapping和Domain object.(使用较多) ...

  7. linux 常见问题

    无root权限install do chmod u+w /etc/sudoers sudo vi /etc/sudoers 找到root   ALL=(ALL:ALL) ALL 在下面加一行: you ...

  8. 【转】Error: no `server' JVM at `C:\Program Files\Java\jre6\bin\server\jvm.dll'.解决办法

    出现问题: 用java -jar XXX.jar -server -Xms900m -Xmx900m 或者 java -server -version 提示错误 Error: no `server' ...

  9. JAVA中REPLACE和REPLACEALL的区别(转)

    replace和replaceAll是JAVA中常用的替换字符的方法,它们的区别是:  1)replace的参数是char和CharSequence,即可以支持字符的替换,也支持字符串的替换(Char ...

  10. ios llvm and clang build tools

    1. 使用 libclan g或 clang 插件 包括( libclang 和  Clangkit) 备注: Clangkit,它是基于 clang 提供的功能,用 Objective-C 进行封装 ...