Crystal Report Windows窗体查看器"未指定错误"

2020-08-24 12:06发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)我们有一个带有嵌入式Crysta...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


我们有一个带有嵌入式Crystal Reports Viewer的WPF桌面应用程序。

我们最近从Crystal 2013升级到了Crystal 2016。

自升级以来,如果任何参数均为数字类型,则Crystal会在参数屏幕后显示错误。

如果没有报告参数,则以下代码有效。 如果存在数字参数,Crystal会显示参数提示,但单击"确定"后,将出现一个带有文本"未指定错误"的消息框,并且报表无法加载。

使用系统;
 使用System.Collections.Generic;
 使用System.Linq;
 使用System.Text;
 使用System.Threading.Tasks;
 使用System.Windows;
 使用System.Windows.Controls;
 使用System.Windows.Data;
 使用System.Windows.Forms;
 使用System.Windows.Input;
 使用System.Windows.Media;
 使用System.Windows.Media.Imaging;
 使用System.Windows.Navigation;
 使用System.Windows.Shapes;
 使用CrystalDecisions.CrystalReports.Engine;
 使用CrystalDecisions.Shared;
 使用CrystalDecisions.Windows.Forms;
 使用表= System.Windows.Documents.Table;

 命名空间CrystalTest
 {
     公共局部类MainWindow:Window
     {
         公共MainWindow()
         {
             InitializeComponent();
         }
         私有void MainWindow_OnLoaded(对象发送者,RoutedEventArgs e)
         {
             字符串reportName = @" C:\ Users \ Dustins \ Documents \ SiteReport.rpt";
             var reportDocument = new ReportDocument();
             reportDocument.Load(reportName);
             ConnectionInfo conInfo =新的ConnectionInfo();
             conInfo.DatabaseName =" MyDb";
             conInfo.UserID =" MyUser";
             conInfo.Password ="我的密码";
             conInfo.ServerName =" MyServer";
             reportDocument.SetDatabaseLogon(conInfo.UserID,conInfo.Password,
             conInfo.ServerName,conInfo.DatabaseName);
             var tli = new TableLogOnInfo();
             tli.ConnectionInfo = conInfo;
             foreach(CrystalDecisions.CrystalReports.Engine.Table选项卡在
                 reportDocument.Database.Tables)
             {
                 tli.ReportName = tab.LogOnInfo.ReportName;
                 tli.TableName = tab.LogOnInfo.TableName;
                 tab.ApplyLogOnInfo(tli);
             }
             var crystalViewer = new CrystalReportViewer();
             crystalViewer.ReportSource = reportDocument;

             System.Windows.Forms.Integration.WindowsFormsHost主机=
                 新的System.Windows.Forms.Integration.WindowsFormsHost();
             host.Child = crystalViewer;
             this.Body.Children.Add(host);
         }
     }
 } 
3条回答
渐行渐远_HoldOn
2020-08-24 12:37

您知道安装了哪个版本的Crystal for VS运行时? 您正在使用什么版本的Windows?

Crystal 2016安装不包括运行时,但是在安装过程中可能会覆盖.dll。

-Dell

一周热门 更多>