Recursion Issue
- by vishwanath katharki
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;
}