cancel
Showing results for 
Search instead for 
Did you mean: 

Report does not prompt for parameters when SeparatePages=False

Former Member
0 Kudos

Hi all. We are using CR2008 Basic w/SP1 along with VS2008. Within our application, reports pull up fine and prompt for parameters using the CrystalReportViewer against the web service. SeparatePages is set to True. We want to change SeparatePages to False, but when I do that any report that should prompt for parameters is not.

The reports were created in CR 8.5. We have upgraded them to CR2008 (open, refresh, save) which has greatly increased performance. With some further testing, I've discovered that if I take a report that doesn't currently have any parameters and add one via VS2008 report designer, it WILL prompt for the parameter when I run it in our application with SeparatePages=False.

So I'm leaning that the problem has to do with the reports originally being created in 8.5. I've tried modifying an existing report with parameters, deleting parameters and re-adding, but I still can't get these to prompt for parameters with SeparatePages=False.

Again, these same reports prompt for parms and work fine as long as SeparatePages=True. I'm hoping someone might be able to shed some light on this. There are over 400 reports so re-creating them from scratch under CR2008 will be a painful option

If I need to provide any additional information just let me know. Thank you!

Sheila

Accepted Solutions (1)

Accepted Solutions (1)

former_member208657
Active Contributor
0 Kudos

Make sure you use the Refresh method after you Load your report. This should discard all your saved data and the current param values.

Former Member
0 Kudos

Hi David. Thanks for your response. Unfortunately, the refresh() method doesn't help. The reports still won't prompt for parameters with SeparatePages=False (but they work fine with SeparatePages=True).

Former Member
0 Kudos

We are still working to resolve this issue. Testing has shown that for reports that don't return a lot of data, the prompt for parameters will display. But for larger reports, we just see the hour glass and the parameter prompt never displays. It's almost like the reports are trying to return the full dataset without any paramters being passed BEFORE it will prompt for parameters. This would explain why smaller reports will prompt and larger reports never will (?). Not sure that is what is happening. Again, with SeparatePages=True we are immediately given the parameter prompt. With SeparatePages=False we run into the issue of no prompts.

Here's the code behind if it help:


ReportDocument report = new ReportDocument();
try
{
    String rptFileName = @"App_Data\Reports\" + Request.QueryString.GetValues(0).GetValue(0).ToString();
    log.writeLog("Loading Report: " + rptFileName);
    String rptFile = Server.MapPath(rptFileName);
    report.Load(rptFile);
    report.Refresh();

    ConnectionInfo crConnectionInfo = new ConnectionInfo();
    log.writeDebugLog("ServerName : " + rProperties.ODBCSource);
    crConnectionInfo.ServerName = rProperties.ODBCSource;
    log.writeDebugLog("DatabaseName : " + rProperties.ODBCSource);
    crConnectionInfo.DatabaseName = rProperties.ODBCSource;
    log.writeDebugLog("UserID : " + rProperties.ODBCUser);
    crConnectionInfo.UserID = rProperties.ODBCUser;
    log.writeDebugLog("Password : " + rProperties.ODBCPassword);
    crConnectionInfo.Password = rProperties.ODBCPassword;

    foreach (CrystalDecisions.CrystalReports.Engine.Table table in report.Database.Tables)
    {
        TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
        crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
        table.ApplyLogOnInfo(crTableLogOnInfo);
    }

}
catch (Exception err)
{
    log.writeLog("Error Loading Report: " + err.ToString());
    this.lblError.Text = err.ToString();
    this.ErrorTable.Visible = true;
    this.ReportTable.Visible = false;
    return;
}

CrystalReportViewer1.HasCrystalLogo = false;
CrystalReportViewer1.ReportSource = report; // _serverFileReport;

}

former_member208657
Active Contributor
0 Kudos

Can you turn on ODBC tracing and see if the Crystal Reports engine is hitting your DB before the param prompt is shown? See if it is running a query against the database.

There were issues in the past with old reports where the old report format was missing some necessary information. When the logon info was passed to the report we'd try to query the original database before applying the new info. This was only a factor with reports before version 9.

In version 9 the issue was addressed by including all the necessary info in the .rpt file so we didn't have to try to query the original DB.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks David. I'm going to setup ODBC tracing. I'm curious to what all it is doing.

Our reports were created in 8.5 and we did noticed a huge performance hit when we tried to open them in the app created with VS2008 using CR basic 2008. We upgraded the reports (open, refresh, save) and that brought overall performance back to what we were used to.

As for this issue, I went ahead and opened a support ticket last week. The support contact was able to recreate the issue we are having (slow to prompt for parms with SepartePages=false). So I'm being told that this is an issue and maybe it will be addressed in the service pack.

Based on this, web reporting is pretty much unusable for us. So we are having to go back to client-side app reporting, which requires infrastructure changes. Not the solution we wanted, but it's tons faster and a better user experience.

Edited by: Sheila Ward on Jan 28, 2009 10:32 AM