Setting dynamic cascading parameters

Using the SDK ›› Parameters ››
Parent Previous Next

 

Report Application Server .NET SDK Developer Guide

Setting dynamic cascading parameters


 







You can preset the parameter values of the first n levels of a cascading prompt group so that the user viewing the report only needs to select values from a subset of the parameters. There are some factors to consider when using dynamic cascading parameters to add this functionality to your application:

NoteNote

The ReportClientDocument object model does not currently support creating new prompt groups programmatically and saving them to the report. For more information about dynamic cascading parameters and creating prompt groups with the Crystal Reports Designer, see the Crystal Reports User's Guide.

This example programmatically sets the first two parameters of a three-level, dynamic cascading prompt in a report. The report has three dynamic cascading parameters: 'Country', 'Region', and 'City'. These values will be pre-populated when the prompt dialog box is rendered, and they will filter the allowed values of the third level parameter, 'City', which can be entered by the user.

Visual Basic

Private Sub SetDynamicCascadingParameters(ByVal rcd As ISCDReportClientDocument)
 rcd.DataDefController.ParameterFieldController.SetCurrentValue("", "Location - Country", "USA")
 rcd.DataDefController.ParameterFieldController.SetCurrentValue("", "Location - Region", "CA")
 myCrystalReportViewer.ReportSource = rcd
End Sub

C#

private void SetDynamicCascadingParameters(ISCDReportClientDocument rcd)
{
 rcd.DataDefController.ParameterFieldController.SetCurrentValue("", "Location - Country", "USA");
 rcd.DataDefController.ParameterFieldController.SetCurrentValue("", "Location - Region", "CA");
 crystalReportViewer.ReportSource = rcd;
}

This list includes the namespaces used by the sample code:

© 2021 SAP AG. All rights reserved.

http://www.sap.com/sapbusinessobjects/

Support services

http://service.sap.com/bosap-support/

Created with the Personal Edition of HelpNDoc: Easily create EPub books