on 09-20-2008 9:23 PM
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!
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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]);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.