将vb.net和Crystal报表部署到客户端PC

时间:2019-03-08 10:10:26

标签: vb.net crystal-reports window

我在PC-A上使用Window 10,带有Crystal Report的VN.NET 2015和Oracle 11g,在PC-B上使用Windows 10,Oracle 11g。

我发布了安装包并在PC-B上运行,它可以正常工作,可以与数据库连接,但是报告不起作用,并且我收到消息:

  

'crystaldecisions.shared.sharedutils'的类型初始化器被抛出   例外

这些是应用程序文件文件夹中包含的dll.deploy文件:

enter image description here

请让我知道如何解决此问题。

enter image description here

project data

My Connection

已更新

connection code

New One

1 个答案:

答案 0 :(得分:0)

只需在代码中添加凭证代码和您将在web.config / app.config文件中设置的实际凭证值即可。然后使用新凭据发布和部署,CR会在运行时自动对其进行更新。

ConnectionInfo crconnectioninfo = new ConnectionInfo();
    ReportDocument cryrpt = new ReportDocument();
    TableLogOnInfos crtablelogoninfos = new TableLogOnInfos();
    TableLogOnInfo crtablelogoninfo = new TableLogOnInfo();

    Tables CrTables;

    crconnectioninfo.ServerName = "localhost";
    crconnectioninfo.DatabaseName = "dbclients";
    crconnectioninfo.UserID = "ssssssss";
    crconnectioninfo.Password = "xxxxxxx";  

检查此链接: How to set database login infos (connection info) for crystal report?

How to stop crystal report viewer from asking login credentials when opening subreport

相关问题