Crystal Reports - “The report you requested requires further information”

一笑奈何 提交于 2020-01-21 05:56:08

问题


I have some Crystal Reports that were created using Crystal (external to Visual Studio) and are now loaded in the VS project. Before the report is previewed I set up the report database information like this in the report and all subreports.

        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);

The report displays correctly when it is initially previewed but when I go to the next page in the report preview I get the message, "The report you requested requires further information" and are prompted for the database login information again. Once I have entered it here I am no longer prompted. It appears that the initial ConnectionInfo I set up is not sticking past the first page.

I am using Crystal XI and Visual Studio 2008.


回答1:


I have found the best way to fix a bug is to post the question to StackOverflow and 5 minutes later work it out yourself. Needless to say, I worked this out.

As well as setting all the log on info in the report objects, I also have to do it in the Crystal Viewer component in ASP.NET. So I just write some code like this and it all works, no prompts.

<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:


Try to set the EnableDatabaseLogonPrompt property in the crystal report viewer to false;




回答3:


Use Data Table instead of Data Set .. It works..




回答4:


put your coding to load event while bind report don't put ispostback=false condition

example

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:


I had same problem but I found a simple solution. i.e. just replace dataset with the data table and it will work fine.




回答6:


If you have added the logon info as follows,

        LogInfo.ConnectionInfo.ServerName = "mcqueen";
        LogInfo.ConnectionInfo.Password = "abc123";
        LogInfo.ConnectionInfo.UserID = "sa";
        LogInfo.ConnectionInfo.DatabaseName = "tbboss";

        crysViewer.LogOnInfo.Add(LogInfo);

simply put the crysViewer.LogOnInfo.Add(LogInfo); at the end of crystal Viewer parameter settings. Like follows.

    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:


Use EnableDatabaseLogonPrompt to see the actual error




回答8:


Solved!.. If it is written in "Not IsPostBack" condition please remove from it. I solved this issue asp below snapshot.

Website link




回答9:


The future is nigh but Crystal Reports persists.

I was receiving this "error" from our crystal reports viewer. My problem was a dynamically generated query that was being created with consecutive ORs. The invalid SQL somehow elevated this "The report you requested requires further information" dialog box.

I fixed the query generation logic and do not see the dialog box anymore.



来源:https://stackoverflow.com/questions/1186048/crystal-reports-the-report-you-requested-requires-further-information

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!