cancel
Showing results for 
Search instead for 
Did you mean: 

How do you get the Crystal Report Viewer to refresh and keep the Parameter entries

Former Member
0 Kudos

Currently if the users refresh the report through the Crystal Report Viewer they will be required to re-enter all of the Parameter selections again.  Is there a way to allow the users to Refresh the report displayed on screen using the current Parameter values?

Accepted Solutions (1)

Accepted Solutions (1)

ido_millet
Active Contributor
0 Kudos

At least one of 3rd-party Crystal Reports viewers listed at http://kenhamady.com/bookmarks.html allows you to refresh (or auto-refresh every N seconds) with the same parameter values. It also provides selective parameter refresh functionality (allowing you to keep values for some parameters and get re-prompted for the rest.

Answers (1)

Answers (1)

0 Kudos

Hi Debbie,

Moved to .NET SDK forums. Same as your other post.

What version are you using? Is this an application you wrote and are using? If yes then one why to resolve it is to get the Default/Current Parameter Values and then apply them on .Refresh method.

Use the Parameter Collection and Current Values and get the values. Then when the refresh method is called apply the values again.

Also check the Viewer Properties, there is an option in there to not discard current values.

And try this:

Re: Does anybody know what DefaultValueDisplayType is?

created by Don Williams in SAP Crystal Reports, version for Visual Studio - View the full discussion

________________________________________

Try this:

if (rptClientDoc.DataDefController.DataDefinition.ParameterFields.Count > 0) //there are parameters
{
    foreach (CrystalDecisions.ReportAppServer.DataDefModel.ParameterField paramfield in rptClientDoc.DataDefController.DataDefinition.ParameterFields)
    {
        switch (paramfield.ValueRangeKind)
        {
            case CrParameterValueRangeKindEnum.crParameterValueRangeKindDiscrete:
                {
                    getDiscreteValues(paramfield);
                    break;
                }
            case CrParameterValueRangeKindEnum.crParameterValueRangeKindDiscreteAndRange:
                {
                    getRangeAndDiscreteValues(paramfield);
                    break;
                }
            case CrParameterValueRangeKindEnum.crParameterValueRangeKindRange:
                {
                    getRangeValues(paramfield);
                    break;
                }
        }
    }
}
private void getDiscreteValues(CrystalDecisions.ReportAppServer.DataDefModel.ISCRParameterField paramfield)
{
    string textBox1 = String.Empty;
    string name = paramfield.Name;
    int currValCount = paramfield.InitialValues.Count;
    int defValCount = paramfield.DefaultValues.Count;
    if (currValCount > 0)  //this parameter has default values
    {
        foreach (ParameterFieldDiscreteValue discreteDefaultVal in paramfield.InitialValues)
        {
            btnReportObjects.AppendText(paramfield.Name.ToString());
            textBox1 = ": " + discreteDefaultVal.Value.ToString();
            btnReportObjects.Text += textBox1;
            btnReportObjects.AppendText("\n");
            //MessageBox.Show(discreteDefaultVal.Value.ToString());
        }
    }
    else
    {
        btnReportObjects.AppendText(paramfield.Name.ToString());
        btnReportObjects.AppendText(": No Initial Value \n");
    }
}

Don

Message was edited by: Don Williams