cancel
Showing results for 
Search instead for 
Did you mean: 

Error code:-2147217394 Error code name:missingParameterValueError

0 Kudos

As seen on:

I have all old code using "com.crystaldecisions.sdk.occa.report.data.Fields" and I would like to iterate through all items and convert them to the new ReportClientDocument, is that possible?

Sample:

ParameterFieldController paramFieldController = reportClientDoc.getDataDefController().getParameterFieldController();	
      for (int i = 0; i < fields.size(); i++) {
        paramFieldController.setCurrentValue(fields.getField(i).REPORTNAME, fields.getField(i).FIELDNAME, fields.getField(i).FIELDVALUE);   
      }

REPORTNAME, FIELDNAME and FIELDVALUE doesn't exist. my "fields" (com.crystaldecisions.sdk.occa.report.data.Fields) variable has a bunch of "ParameterField" objects, if I could retrive those 3 properties I could fill-in all parameters.

Thanks!

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

Well, if there is no other way to fix it. Actually by just adding the field to the report fields list will work, it doesn't even need to be dragged somewhere on the sections. thanks.

0 Kudos

Ok, the exception is thrown when I add a parameter that does not exists on the report, can I disable this? I have global parameters that are used on most reports that I always add to the fields collection.

Thank you

Former Member
0 Kudos

You can't disable that error message, however an easy way to work around it would be to add your parameters to a suppressed section (hide them) so that they are in the report for you to access but you never actually see them.

0 Kudos

Oh great, now I'm getting an exception on some reports:

The field was not found.

here:

ParameterFieldController paramFieldController = reportClientDoc.getDataDefController().getParameterFieldController();	
      for (int i = 0; i < fields.size(); i++) {
        if (fields.getField(i) != null)
        {
            paramFieldController.setCurrentValue(((ParameterField)fields.getField(i)).getReportName(), ((ParameterField)fields.getField(i)).getName(), ((ParameterField)fields.getField(i)).getCurrentValues().toArray()[0]);   
        }
      }

0 Kudos

I figured out how to do that however the outputted PDF still has the java class name as the filename, what am I missing now?

ParameterFieldController paramFieldController = reportClientDoc.getDataDefController().getParameterFieldController();	
      for (int i = 0; i < fields.size(); i++) {
        paramFieldController.setCurrentValue(((ParameterField)fields.getField(i)).getReportName(), ((ParameterField)fields.getField(i)).getName(), ((ParameterField)fields.getField(i)).getCurrentValues());   
      }
              
      ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
      reportClientDoc.close();
      writeToBrowser(byteArrayInputStream, response, "application/pdf", "myfile.pdf");

Thanks