Jaspereports でPDF出力する時に、注意が必要なのは、
JasperFillManager.fillReport で DataSource を指定して、出力後、
もう一度、同じDataSource を使い回そうとして使用すると出力結果が空になってしまう。????
例えば、、、
JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(beans);
JasperPrint jasperPrint = JasperFillManager.fillReport(new FileInputStream(templateFile), parameters, dataSource);
を実行後、別のテンプレートで同じ dataSource を使用して、JasperFillManager.fillReport を実行そてできる、JasperPrint の getPages().size() の結果が、0になってしまう。
JasperFillManager.fillReport と、使用する JRBeanCollectionDataSource は都度、生成しないとならない。
これが解らなく、すごく悩んだ。