SAP Knowledge Base Article - Public

1200894 - How to set the parameters of a report based on a Command and to change the data source at the same time

Symptom

A Java Reporting Component (JRC) application is unable to programmatically set the parameters in a report when the report is based on a command object(s) and the data source is being changed at the same time.

Resolution

Use the following workaround:

// Get the command table
IProcedure table = (IProcedure ) tables.getTable(i).clone (true); 
...
// Set other properties on the table
ParameterField paramField = (ParameterField) table.getParameters ().get (0);
Values curValues = new Values ();
ParameterFieldDiscreteValue parameterValue = new ParameterFieldDiscreteValue ();
 
// Set the parameter value
parameterValue.setValue (new Integer (1));
curValues.add (parameterValue)
paramField.setCurrentValues (curValues);
 
//Update old table in the report with the new table.
databaseController.setTableLocation (table, tables.getTable(i));

Keywords

java , 5368677 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports XI ; SAP Crystal Reports XI R2