由于工作的需要,需要将多个jasper导入到一个excel中,并且是放置到不同的sheet页中,

研究了下需要做如下操作

JRXlsExporter xls = new JRXlsExporter();
xls.setParameter(JRExporterParameter.JASPER_PRINT_LIST,list);//此处的list为JasperPrint的list集合 xls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);//设置为true,即可在一个excel中,每个单独的jasper对象放入到一个sheet页中

String[] sheetNames = {"自定义1","自定义2","自定义3"};
xls.setParameter(JRXlsExporterParameter.SHEET_NAMES, sheetNames);//此处这样写即可

一些小技巧,与大家分享一下!

 

 

 

相关文章:

  • 2021-11-30
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-06-18
  • 2021-09-08
  • 2022-01-31
猜你喜欢
  • 2022-02-09
  • 2021-08-25
  • 2021-08-04
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2021-08-12
相关资源
相似解决方案