c# - Crystal Reports 和 Report Viewer 运行时问题

标签 c# crystal-reports reportviewer

使用 vs2008 c#。 你好, 我有一个应用程序,我试图决定是否应该使用 Crystal 报表或 visual studio 安装附带的报表查看器。

我的问题是,虽然它在我的开发机器上运行良好,但许多将应用程序部署到远程位置的机器不会安装 Crystal Reports 或报表查看器的运行时。

因此,如果我使用其中任何一个构建应用程序,并阻止用户仅在没有运行时的机器上访问报告,应用程序是否可以正常运行,或者我应该预料到安装时会出现疯狂的错误等等

感谢任何建议。

最佳答案

您实际上可以通过部署项目或 ClickOnce 将 Crystal Reports 运行时包含在您的部署包中。在运行时,您可能会遇到错误,您可以像这样在 catch 语句或 application_threadexception 事件上处理这些错误:

private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
    {
        //For missing crystal reports assembly
        if ((e.Exception is System.IO.FileNotFoundException) && (e.Exception.Message.IndexOf("CrystalDecisions.CrystalReports.Engine") > -1))
            MessageBox.Show("Crystal Reports is required to use this feature", "Crystal Reports", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
       }

关于c# - Crystal Reports 和 Report Viewer 运行时问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2406197/

相关文章:

c# - IPAddress 上的奇怪 .Net 行为等于

crystal-reports - 从 Crystal Reports 8 迁移到 Crystal Reports 2008

reportviewer - ASP.NET 4.0 中报告查看器控件和 RDLC 报告的安全错误

c# - 乘除运算符周围的空格被IDE删除了,如何保留?

c# - NHibernate QueryOver RowCount,区分 0 和 NULL

java - CR4E Crystal Reports保存修改后的ChartObject

dataset - Report Viewer 2010 中设计时数据源的要求

.net - ReportViewer (RDLC) 上的文本框不换行但强制分页

c# - 按第二列对锯齿状数组进行排序

crystal-reports - 在数字字段的 Crystal 报告中删除小数