Skip to Content

passing multiple values to a field in crystal report

Using java code, How to pass multiple values from list to a field in a crystal report which accepts multiple values. my code

if (reportNameValue.equalsIgnoreCase("MY REPORT")) { System.out.println("PDF ENTERED : INSIDE ATM HISTORICAL REPORT "); fields = rcd.getDataDefController().getDataDefinition().getParameterFields(); ParameterFieldController paramFieldController = rcd.getDataDefController() .getParameterFieldController(); for (int i = 0; i < fields.size(); i++) { System.out.println(fields.getField(i).getName()); if (fields.getField(i).getName().equalsIgnoreCase("Select VALUE")) { System.out.println("entered here ashok check now"); System.out.println("entered here ashok check now"); /*for (IField iField : fields) { } */ for (String bankNames : selectedBanks) { System.out.println(bankNames); paramFieldController.setCurrentValue("", "Select Bank", bankNames); } } } }

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jul 06, 2018 at 11:41 PM

    If your parameter filed accepts multiple values, then create an array of Values and use the paramFieldController.setCurrentValues method to pass in the array:

    setCurrentValues(java.lang.String sReportName,

                                 java.lang.String sFieldName,
                                 java.lang.Object[] newValue)
                          throws ReportSDKException
    Dan
    Add comment
    10|10000 characters needed characters exceeded