Ireport receives list collection summary from java background

  1. First, create a parameter list in the Parameters in the main dataset (pass the key of the map in the background, such as map.put("list",list1)), and modify its type to java.util.Collection;

  2. Then add the List (component) component in its Detail, and place the data to be displayed in the List box;

  3. Right-click List(component), select Edit list datasource, set Connection/Datasource Expression to   new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{list}) , click ok, use $F{property name} to get the object corresponding property value.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325681116&siteId=291194637