boa tarde galera, crie dois relatorios, um mestre e um filho, preciso chamar o relatorio mestre, pois tem as configuracoes de cabecalho, rodape, etc… e passar o sub-relatorio como parametro, mais nao sei como chamar os dois relatorios pelo netbeans, abaixo segue codigo:
public void geraRelatorio(String caminho, int idClinica) throws Exception {
JasperViewer JasperViewer;
try {
HashMap<String, Integer> parClinica = new HashMap<String, Integer>();
parClinica.put("id_clinica",idClinica);
JasperReport jasper = (JasperReport) JRLoader.loadObject(getClass().getResourceAsStream(caminho));
JasperPrint jasperPrint = JasperFillManager.fillReport(jasper, parClinica, getConnection());
if (jasperPrint.getPages().isEmpty()) {
JOptionPane.showMessageDialog(null, "O Documento não possui paginas");
return;
}
JasperViewer = new JasperViewer(jasperPrint, false);
JasperViewer.setTitle("xxxxxxxxxxxxxxxxxxx");
JasperViewer.setVisible(true);
} catch (JRException ex) {
ex.printStackTrace();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} catch (SQLException ex) {
ex.printStackTrace();
}
closeConnection();
}
alguem poderia me ajduar
vlws