Passing the List of primitive type objects as datasource for subreport

前端 未结 3 1186
面向向阳花
面向向阳花 2020-11-30 05:18

I need to pass to my subreport a dataSource with help of master report\'s List parameter. I don\'t know what is

3条回答
  •  执笔经年
    2020-11-30 05:52

    Yes it works. It's totally not clearly documented but it works with jasperreport 4.5.1.

    You have to declare a field into your subreport named "_THIS", typed with your primitive type you want to display. In this case, a String.

    SubReport

    
    
        
            
        
        
        
      ...
    

    Then in this subreport where you want to display the String value, just use $F{_THIS}.

    
        
            
                
                
                
            
        
    
    

    Main report

    The parent report provide the List as the datasourceExpression

    
        
        
        
    
    

    I took inspiration here

提交回复
热议问题