Recursion Issue

Posted by vishwanath katharki on Stack Overflow See other posts from Stack Overflow or by vishwanath katharki
Published on 2010-04-20T06:29:30Z Indexed on 2010/04/20 6:33 UTC
Read the original article Hit count: 471

Filed under:
|

I am not able to populate the Map with the following recursive code. Can anybody help ?`

public Map<String,JasperReport> getCompiledSubReports(JasperDesign jasperDesign, Map<String,JasperReport> hm) throws JRException{

if(hasSubReports(jasperDesign) && !allSubreportsProcessed(jasperDesign,hm)){ HashMap hashSet = getJasperDesignsForSubReports(jasperDesign); Set keySet = (Set) hashSet.keySet(); for(String s: keySet){ System.out.println(" Calling getCompiledSubReports " ); JasperDesign jsDesign = (JasperDesign) hashSet.get(s); if(hasSubReports(jsDesign) && !allSubreportsProcessed(jsDesign,hm)){ hm.putAll(getCompiledSubReports(jsDesign,hm)); } else{ JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); String nameParameter = getParameterByName(jasperDesign); if(nameParameter == null){ System.out.println(" No Name parameter! Cannot proceed !!!"); } hm.put(nameParameter,jasperReport); return hm; } } } return hm; }

© Stack Overflow or respective owner

Related posts about java

Related posts about jasper-reports