“您要求的报告需要更多信息”错误

时间:2017-08-28 05:58:33

标签: asp.net vb.net crystal-reports

任何人都可以帮助我解决水晶报道上的这个问题:

CR version 13.0.20.2399  
Visual Studio Ultimate

当我尝试从第一页移动到第二页时,我收到此提示,

  

您要求的报告需要更多信息

以下是我的代码:

    myRrpt.Load(Server.MapPath("~\Reporting\CrystalReport15.rpt"))

    connect_EWS.ConnectionString = Constr_EWS
    Dim con As New SqlCommand
    Dim query As String = "SELECT * from Report_BT where Number=@num"
    con.CommandText = query
    con.Connection = connect_EWS
    con.Parameters.AddWithValue("@num", txtNumber.Text.Trim)
    connect_EWS.Open()
    '  Dim dsCustomers As New ISAE_BankTransfer
    Dim da As New SqlDataAdapter(con)

    Dim dsCustomers As DataSet4 = New DataSet4

    da.Fill(dsCustomers, "Report_BT")
    connect_EWS.Close()

    myRrpt.SetDataSource(dsCustomers.Tables(0))
    CrystalReportViewer1.DisplayPage = True

    CrystalReportViewer1.ReportSource = myRrpt

该网站在Windows Server 2012 DataCenter内部发布

1 个答案:

答案 0 :(得分:0)

在代码中添加数据库连接的凭据。所以它也会在第二页获得信息。逻辑是在晶体报告中进行分页时,它也会在db中获取第二组数据。

var connectionInfo = new ConnectionInfo();
    connectionInfo.ServerName = "192.168.x.xxx";
    connectionInfo.DatabaseName = "xxxx";
    connectionInfo.Password = "xxxx";
    connectionInfo.UserID = "xxxx";
    connectionInfo.Type = ConnectionInfoType.SQL;
    connectionInfo.IntegratedSecurity = false;

for (int i = 0; i < Viewer.LogOnInfo.Count; i++)
{
    Viewer.LogOnInfo[i].ConnectionInfo = connectionInfo;
}

Crystal Reports - "The report you requested requires further information"