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 ...
随机推荐
- cxf
一,cxf webService入门案例 1,jar包 注意版本 使用jdk6和apache-cxf-3.1.2,但cxf-3.1.2已经不支持jdk6,需要jdk7以上 版本用错会报java.lan ...
- 异常的应用finally与总结
一.finally{ },finally块中放入一定要执行的代码,通常用来关闭数据库,关闭链接,节约资源,所以finally中的内容一定要被执行,但是有一张情况不被执行,就是catch(Excep ...
- 将HTML表格导出到EXCEL,兼容Firefox,支持中文
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Oracle 返回结果集的 存储过程
create or replace PROCEDURE SPGETROLELIST ( P_APPCODE IN VARCHAR2 , P_USERROLE IN VARCHAR2 , CUR_RES ...
- C#集合之ArrayList
C#中之所以有集合这个东东,是因为数组的长度是固定的,而实际需求是,不确定未来这个“数组”的个数,故出现集合这个概念,因为集合的容量会随元素的增加曾倍数增长.C#中有2类常用集合:ArrayList, ...
- jsp页面在IE8下文本模式自动为“杂项(Quirks)”导致页面显示错位
最近在修改网站的响应式的页面时,由于都是套样式页面,修改过程都是粘贴复制,导致了一些细节问题在IE8下暴露出来: 遇到的问题就是在在Chrome,火狐页面都正常,唯独在IE8下页面样式显示乱样了,但是 ...
- ###STL学习--vector
点击查看Evernote原文. #@author: gr #@date: 2014-08-11 #@email: forgerui@gmail.com vector的相关问题.<stl学习> ...
- iOS调试程序时,启动应用失败的解决办法
最近在iOS项目中调试程序,项目中用到第三方应用来启动我的应用程序,调试阶段在实体机上用第三方应用启动我的应用时,出现如下错误,程序停止运行: 同时,在AppDelegate对象的如下方法中设置断点: ...
- mysql net连接读取结果为乱码 Incorrect string value
在mysql直接查询中文正常,通过连接到mysql读取中文内容为乱码.同时插入中文内容也失败提示 Incorrect string value: '\xBC\xA4\xB7\xA2\xBF\xB4.. ...
- Windows下lex 与 yacc的使用(2)
Windows下lex 与 yacc的使用 ...