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. 如何将java代码生成一个bat文件

    java -cp classes;lib/* beans.FileUpload  列出所要带的参数,用空格分开Pause

  2. Android之UI--重绘EditText以及实现Button的渐变色

    在本文中实现的是比较普遍的一个对EditText的重绘以及对于按钮或窗口添加渐变色. 因为EditText是继承于TextView的,所以可以实现对EditText的重绘,在重绘的时候只需要继承Edi ...

  3. 利用JS_SDK实现QQ第三方登录

    前言 现如今,第三方登录已成为大部分网站必备的一项基础技能,引入时髦的第三方登录不仅能帮你吸引更多的用户,也让你的网站可以充分利用其他大型网站的用户资源.本次教程将让你的网站最快捷便利地引入QQ登录. ...

  4. ajax数据保存及解析

    1.   $('#frmCam').serialize():serialize() 方法通过序列化表单值,创建 URL 编码文本字符串. 2.自动对应ID和值 window.camConfig = [ ...

  5. Android Studio中文组(中文社区)

    Android Studio中文组(中文社区)http://www.android-studio.org/

  6. [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法

    参考 [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 ---------------------------------------- ...

  7. PHP之文件目录基础操作

    我们知道,临时声明的变量是保存在内存中的,即便是静态变量,在脚本运行完毕后也会被释放掉,so,想长久保存一个变量的内容,方法之一就是写到文件中,放到硬盘或服务器上,为此文件操作就必须很熟悉. 1.文件 ...

  8. 利用sys.dm_db_index_physical_stats查看索引碎片等数据(转)

    我们都知道,提高sql server的数据查询速度,最有效的方法,就是为表创建索引,而索引在对数据进行新增,删除,修改的时候,会产生索引碎片,索引碎片多了,就需要重新组织或重新生成索引,以达到索引的最 ...

  9. cocos2d-x实战 C++卷 学习笔记--第6章 场景与层

    前言: 一个场景(Scene)是由多个层(Layer)组成,而且层的个数要至少是1,不能为0. 场景切换 场景切换相关函数 1)void  runWithScene(Scene*  scene) 该函 ...

  10. 12天学好C语言——记录我的C语言学习之路(Day 8)

    12天学好C语言--记录我的C语言学习之路 Day 8: 从今天开始,我们获得了C语言中很有力的一个工具,那就是函数.函数的魅力不仅于此,一个程序到最后都是由众多函数组成的,我们一定要用好函数,用熟练 ...