Java中jasperReport实现动态列打印的实现代码
以下代码中注释说明很清楚,希望能帮助到大家,大家参考下。
示例代码:
publicActionResultprojectPrint(){
String[]printValue=null;
//从页面中获得要查询的字段
StringreqPrintValue=getRequest().getParameter("printValue");
//没有选择则默认全打印
if(null==reqPrintValue||StringUtils.isEmpty(reqPrintValue)){
printValue=newString[]{"pnumber","pname","pdepart","pdecision","pthrow","plastmonth","pfund","ploan"};
}else{
printValue=reqPrintValue.split(",");
}
//查询统计数据
List