i used this for map-based datsource in jasper reports.
def action()
{
HashMap[] reportRows = new HashMap[2];
HashMap row1Map = new HashMap();
HashMap row2Map = new HashMap();
row1Map.put("name", "aaditya");
row1Map.put("lastname", "bhatta");
row1Map.put("phone", "9848782444");
row1Map.put("gender", "male");
row2Map.put("name", "aaditya");
row2Map.put("lastname", "bhatta");
row2Map.put("phone", "9848782444");
row2Map.put("gender", "male");
reportRows[0] = row1Map;
reportRows[1] = row2Map;
}
now you can use map reportRows for the datasouce in you jasper reports .
as ::
chain(controller:'jasper', action:'index', model:[data:reportRows],params:params)
def action()
{
HashMap[] reportRows = new HashMap[2];
HashMap row1Map = new HashMap();
HashMap row2Map = new HashMap();
row1Map.put("name", "aaditya");
row1Map.put("lastname", "bhatta");
row1Map.put("phone", "9848782444");
row1Map.put("gender", "male");
row2Map.put("name", "aaditya");
row2Map.put("lastname", "bhatta");
row2Map.put("phone", "9848782444");
row2Map.put("gender", "male");
reportRows[0] = row1Map;
reportRows[1] = row2Map;
}
now you can use map reportRows for the datasouce in you jasper reports .
as ::
chain(controller:'jasper', action:'index', model:[data:reportRows],params:params)
0 comments:
Post a Comment