JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(dataSource);
JasperPrint jp = JasperFillManager.fillReport(fileName, parameter, ds);
return printJasper(jp, printOrPreview, withPrintDialog);
}
public static JasperViewer printJasper(String fileName, Map parameter, Collection dataSource, int printOrPreview, boolean withPrintDialog, String title) throws JRException {
JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(dataSource);
JasperPrint jp = JasperFillManager.fillReport(fileName, parameter, ds);
return printJasper(jp, printOrPreview, withPrintDialog, title);
}