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 ...
随机推荐
- ListView滑动不爽,滚动一页得滑几次?该用分页列表啦!
ListView等滚动位置经常不符合用户期望: 很多时候都是看完一页想滑到下一页,但滑动一次距离往往不是不够就是超过,很难控制. PagedListView工程中提供了PageScroller来解决这 ...
- VFS对象总结
关键术语: 超级快(super block)对象: 一个超级块对应一个具体的文件系统(已经安装的文件系统类型如 ext2,此处是实际的文件系统,不是 VFS). iNode 对象: inode是内核文 ...
- selenium添加源码,解决打开源码不显示问题
问题1: 我已经导入了源码包,单在源码中点击get,想查看源码 WebDriver driver=new FirefoxDriver(); driver.get("http://www.ba ...
- Leetcode 104. Maximum Depth of Binary Tree(二叉树的最大深度)
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the long ...
- 倒影(box-reflect)
box-reflect: 语法:box-reflect:none | <direction> <offset>? <mask-box-image>?因为不是w3c标 ...
- 第一个Cookie应用
Cookie应用:显示用户上次访问时间 package com.itheima.cookie; import java.io.IOException; import java.io.PrintWrit ...
- Linux命令行程序和内建指令
摘录百度分类 文件系统 cat cd chmod chown chgrp cksum cmp cp du df fsck fuser ln ls lsattr lsof mkdir mount mv ...
- ping 命令详解
Linux系统的ping命令是常用的网络命令,它通常用来测试与目标主机的连通性,我们经常会说"ping一下某机器,看是不是开着".不能打开网页时会说"你先ping网关地址 ...
- linux安装缺失服务
sudo apt-get install ssh Reading package lists... Done Building dependency tree... Done Package ssh ...
- 【转】代码高处走 从VC6到VC9移植代码问题说明
首先可以直接用Visual Studio 2008的打开VC6的工作区文件和项目文件(dsw和dsp),并将其升级为VS2008的解决方案格式和项目格式(sln和vcproj),VC9的编译器相对于V ...