代码之家  ›  专栏  ›  技术社区  ›  Craig

Crystal Reports-“您要求的报告需要更多信息”

  •  1
  • Craig  · 技术社区  · 16 年前

            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;
    
            TableLogOnInfo logon = table.LogOnInfo;
            table.LogOnInfo.ConnectionInfo = connectionInfo;
            table.ApplyLogOnInfo(logon);
    

    9 回复  |  直到 16 年前
        1
  •  6
  •   Craig    16 年前

    <CR:CrystalReportViewer Height="500px" ID="Viewer" runat="server" />
    
    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;
    }
    
        2
  •  4
  •   chris    13 年前

    EnableDatabaseLogonPrompt false;

        3
  •  3
  •   Kiran Solkar    13 年前

    使用数据表而不是数据集。它奏效了。。

        4
  •  1
  •   Marek Grzenkowicz    14 年前

    在绑定报告时将您的编码放在加载事件上,不要放ispostback=false条件

    例子

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim dt As New dsPrintRevisionStatus
        Try
            lblHeader.Text = Request.QueryString("name")
            If lblHeader.Text = "Report- Print Revision Status" Then
                Dim rpt As New rpt_PrintRevisionStatus
                rpt.SetDataSource(sqlHandler.ExecuteDataTable("SELECT * FROM [Print Revision Status]"))
                crtViewer.ReportSource = rpt
                crtViewer.DataBind()
    
            End If
        Catch ex As Exception
            lblError.Text = ex.Message
        End Try
    End Sub
    
        5
  •  0
  •   Aamir Shahzad    12 年前

    我也遇到了同样的问题,但我找到了一个简单的解决方案。即只需更换 dataset data table

        6
  •  0
  •   Chathura Hapuwalana    11 年前

            LogInfo.ConnectionInfo.ServerName = "mcqueen";
            LogInfo.ConnectionInfo.Password = "abc123";
            LogInfo.ConnectionInfo.UserID = "sa";
            LogInfo.ConnectionInfo.DatabaseName = "tbboss";
    
            crysViewer.LogOnInfo.Add(LogInfo);
    

    只需放置crysViewer即可。LogOnInfo。添加(日志信息);在crystal Viewer参数设置结束时。如下所示。

        LogInfo.ConnectionInfo.ServerName = "mcqueen";
        LogInfo.ConnectionInfo.Password = "abc123";
        LogInfo.ConnectionInfo.UserID = "sa";
        LogInfo.ConnectionInfo.DatabaseName = "tbboss";
    
    
        int exportFormatFlags =(int)(CrystalDecisions.Shared.ViewerExportFormats.PdfFormat | CrystalDecisions.Shared.ViewerExportFormats.ExcelFormat);
        crysViewer.AllowedExportFormats = exportFormatFlags;
        crysViewer.ReportSource = Server.MapPath("Reports/Report1.rpt");
        crysViewer.ParameterFieldInfo = paramFields;
    
        crysViewer.LogOnInfo.Add(LogInfo);
    
        7
  •  0
  •   irfandar    10 年前

        8
  •  0
  •   Abdul Khaliq    7 年前

    解决了的!..如果它写在“Not IsPostBack”条件下,请从中删除。我在下面的快照中解决了这个问题。 enter image description here

    Website link

        9
  •  0
  •   Jon    6 年前

    我修复了查询生成逻辑,不再看到对话框。