Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Solution for working with modal window and JasperReport / iReport. / Solução para se trabalhar com janela modal e JasperReport/iReport.
public void gerarReport(String filePath, List list) throws Exception {
JDialog dialogReport = new JDialog(new javax.swing.JFrame(), "TITLE REPORT", true);
dialogReport.setSize(1000, 700);
InputStream fileReport = getClass().getResourceAsStream(filePath);
Map params = new HashMap();
JRBeanCollectionDataSource dataList = new JRBeanCollectionDataSource(list);
JasperPrint print = JasperFillManager.fillReport(fileReport, params, dataList);
JasperViewer windowJasper = new JasperViewer(print, true);
if ( print.getPages().size() > 0 )
throw new Exception("No Pages!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.