krysna
Programmer
- May 20, 2008
- 22
I am trying to pass params to my report via a java servlet. It is exporting the report to a PDF.
Everything works fine for "single" params, but when I try to pass params with multiple values, I am only getting the first one.
Here is my code:
Fields fields = (Fields)request.getAttribute("parameterList");
logger.debug("passed in param fields:");
for (int i = 0; i < fields.size(); i++) {
ParameterField pf = (ParameterField)fields.get(i);
Values v = pf.getValues();
if (v.size() > 0) {
ParameterFieldDiscreteValue pfdv = (ParameterFieldDiscreteValue)v.get(0);
logger.debug(pf.getName() + " - " + pfdv.getValue());
try {
reportClientDoc.getDataDefController().getParameterFieldController().setCurrentValue("",pf.getName(), pfdv.getValue());
} catch (ReportSDKInvalidParameterFieldCurrentValueException e) {
logger.debug(pf.getName() + " is not valid!");
}
} else {
logger.debug(pf.getName());
}
}
I think it has something to do with using the discrete value, as that is for just a "single" value, but I can't figure out how to access the multiple values.
The code being used to add the multiple values is calling addElement() for each multi-value, but I can't figure out how to get those and pass them into my report.
Any help is greatly appreciated!
Everything works fine for "single" params, but when I try to pass params with multiple values, I am only getting the first one.
Here is my code:
Fields fields = (Fields)request.getAttribute("parameterList");
logger.debug("passed in param fields:");
for (int i = 0; i < fields.size(); i++) {
ParameterField pf = (ParameterField)fields.get(i);
Values v = pf.getValues();
if (v.size() > 0) {
ParameterFieldDiscreteValue pfdv = (ParameterFieldDiscreteValue)v.get(0);
logger.debug(pf.getName() + " - " + pfdv.getValue());
try {
reportClientDoc.getDataDefController().getParameterFieldController().setCurrentValue("",pf.getName(), pfdv.getValue());
} catch (ReportSDKInvalidParameterFieldCurrentValueException e) {
logger.debug(pf.getName() + " is not valid!");
}
} else {
logger.debug(pf.getName());
}
}
I think it has something to do with using the discrete value, as that is for just a "single" value, but I can't figure out how to access the multiple values.
The code being used to add the multiple values is calling addElement() for each multi-value, but I can't figure out how to get those and pass them into my report.
Any help is greatly appreciated!