Hello!
In my servlet :
IRunAndRenderTask task = engine.createRunAndRenderTask(reportDoc);
task.setParameterValue("production",objectMap.get("numberbso"));
task.setParameterValue("dateInvoice", objectMap.get("dateinvoice"));
task.setParameterValue("list",objectMap.get("listitems"));
task.setRenderOption(option);
task.validateParameters();
parameters production and dateInvoice rendered in report.
Parameter list does't render (
in serviceImpl class map :
@SuppressWarnings("MagicConstant")
public <T extends WarehouseShippingWaybill> Map<String, Object> constructBirtReportGoodsWaybill(Class<T> c, Long id) {
// some code..
WarehouseShippingWaybill waybill = getDocument(WarehouseOutgoingGoodsWaybill.class, id);
DateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy");
root.put("dateinvoice", returnStringDateFormat(dateDocument));
root.put("organization", organization);
// some code..
List<TypeService> entryInternal = returnListTableGoodsInvoice(contract, waybill.getOperationEntries(), organization);
root.put("listitems", entryInternal);
// some code..
return root;
}
and there is method for entryInternal
public List<TypeService> returnListTableGoodsInvoice(Contract contract, List<WarehouseDocumentOperationEntry> warehouseItems, Organization organization) {
List<TypeService> list = new ArrayList<>();
for (WarehouseDocumentOperationEntry warehouseItem : warehouseItems) {
TypeService service = new TypeService();
String countryTitle = "";
if (warehouseItem.getItemType().getCountry() != null) {
countryTitle = dictionaryService.get(Country.class, 500l).equals(warehouseItem.getItemType().getCountry()) ? "" : ", " + warehouseItem.getItemType().getCountry().getCode();
}
service.setName(warehouseItem.getItemType().getTitle()
+ countryTitle);
service.setUnit((warehouseItem.getItemType().getUnit() != null) ? warehouseItem.getItemType().getUnit().getDescription() : "");
service.setNumber(warehouseItem.getAmount());
BigDecimal vat = new BigDecimal(0);
// some code
service.setLoadWeight(warehouseItem.getAmount().multiply(warehouseItem.getItemType().getNetWeight()).setScale(3, RoundingMode.HALF_UP));
}
list.add(service);
}
return list;
}
in report I'm trying get it with Report Parameters
(picture in attached file)
but something wrong and it's dose't work .