Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » send array in report with etParameterValue
send array in report with etParameterValue [message #1456610] Thu, 30 October 2014 14:36
Ihar Rubanovich is currently offline Ihar RubanovichFriend
Messages: 3
Registered: October 2014
Junior Member
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 .

Previous Topic:Parameter check against database value
Next Topic:API problems
Goto Forum:
  


Current Time: Wed Oct 17 02:51:26 GMT 2018

Powered by FUDForum. Page generated in 0.01924 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top