check whether the crystal report runtime is exists 检查crystalreport运行时是否存在
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运行时是否存在的更多相关文章
- RTTI (Run-Time Type Identification,通过运行时类型识别) 转
参考一: RTTI(Run-Time Type Identification,通过运行时类型识别)程序能够使用基类的指针或引用来检查这些指针或引用所指的对象的实际派生类型. RTTI提供了以下两个 ...
- Using Run-Time Dynamic Linking(使用运行时动态链接库)
// A simple program that uses LoadLibrary and // GetProcAddress to access myPuts from Myputs.dll. #i ...
- 运行时环境(The Runtime Environment)
App Engine应用响应网络请求.当一个客户端(典型的是用户的Web浏览器)使用HTTP请求(比如获取在URL上的网页)连接上应用的时候,网络请求就开始了.当App Engine接收到请求时,它会 ...
- [转帖]运行时库(runtime library)
运行时库(runtime library) https://blog.csdn.net/xitie8523/article/details/82712105 没学过这些东西 或者当时上课没听 又或者 ...
- 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 ...
- Visual Studio 2017 集成Crystal Report为ASP.NET MVC呈现报表
最近项目需要实现报表功能,平衡各方面的因素,还是使用Crystal Report(水晶报表) 下载较新版本: http://downloads.businessobjects.com/akdlm/cr ...
- 2.ASP.NET MVC 中使用Crystal Report水晶报表
上一篇,介绍了怎么导出Excel文件,这篇文章介绍在ASP.NET MVC中使用水晶报表. 项目源码下载:https://github.com/caofangsheng93/CrystalReport ...
- 解决Crystal Report XI R2不能在64操作系统正常工作的问题-web程序
原文:[原创]解决Crystal Report XI R2不能在64操作系统正常工作的问题-web程序 我更换了新的电脑,操作系统也从原来32位的windows 2003 R2升级到windows 2 ...
- Crystal Report 在 VS 2010 中的使用和发布
原文:Crystal Report 在 VS 2010 中的使用和发布 使用: 打开CrystalReport官网下载页 目前最新版本为13.0.4 选择“SAP Crystal Reports, v ...
随机推荐
- Debug 之 VS2010网站生成成功,但是发布失败
用vs做好了网站.清理解决方案和重新生成解决方案都可以.但是发布不能成功.发布不能成功,有错误还好,郁闷的是竟然没有错误提示. 解决方法: 1.发布文件夹权限问题.重新找个地方建立一个发布文件夹即可. ...
- Windows系统下用命令行编译C/C++程序过程总结
转自:http://www.cnblogs.com/caikehe/archive/2013/01/12/2858017.html (1)先用记事本编写如下所示的代码,并另存为hello.cpp,假设 ...
- 命令行界面下用户和组管理之groupmod和groupdel的使用
NAME groupmod - modify a group definition on the system SYNOPSIS groupmod [options] GROUP O ...
- 关于SWT/JFace的API文档
在CSDN上下了几个CHM格式的文档,下载的时候要付的分数还挺高,但是下载下来三个都不能用,左边罗列了所有的类和方法.双击按回车右边都没有内容. 真坑爹. >>>>>&g ...
- [设计模式]观察者模式1(用JDK提供的API)
观察者模式: 被观察的类: package cn.itcast.obserdemo; import java.util.Observable; //House是被观察的,这里直接继承java中的类库( ...
- app测试点
手机上的app分为基于HTML5的app(类似于pc上的b/S应用)和本地app(类似于C/S结构). 所以测试上我们也可以充分吸收web的b/s和c/s测试经验.但是不同于pc上的应用测试,手机上的 ...
- springmvc前后端传值总结
1 前端向后端传参 1.1 普通方式传参 1.1.1 页面 参数需要解析成json对象:JSON.parse(JSON.stringify(query)) $.getJ ...
- ios Swift 资源池
Swift入门教程: http://www.cocoachina.com/applenews/devnews/2014/0604/8661.html Swift视频教程: http://www.coc ...
- 第六篇、CSS属性
<!--1.可继承性 visible(可见的):hidden --掩藏,但是结构还保存 cursor(光标样式):pointer(手指)crosshair(十字架) 一般是文字控制属性 内联标签 ...
- easyui-prompt弹出框操作
效果图如下: 代码如下: $(document).ready(function () { //绑定按钮操作 $('#btnMove').click(function () { var ids = ge ...