Olá amigos, queria dividir com vcs esse erro quando tento geral um relatório pelo. primeiro vou postar o método que faz gera relatórios com Ireport.
identar texto pré-formatado por 4 espaços
private void ImprimirORA() {
int confirma = JOptionPane.showConfirmDialog(null, “Confirma Emissão Desta Ordem de Acampamento?”, “Atenção”, JOptionPane.YES_NO_OPTION);
if (confirma == JOptionPane.YES_OPTION) {
// imprimir relatório com frame
try {
// filtro
HashMap filtro = new HashMap();
filtro.put("OrA", Integer.parseInt(Nuacamp.getText()));
JasperPrint imprimir = JasperFillManager.fillReport("C:/reports/OrdemAcampamento.jasper", filtro, conexao);
// linha exibe relatorio
JasperViewer.viewReport(imprimir, false);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}
}
}
onde ele chama no botão imprimir
identar texto pré-formatado por 4 espaços
private void RelatorioAcampActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int confirma = JOptionPane.showConfirmDialog(null, “Confirma Emissão Deste Realatório?”,“Atenção”,JOptionPane.YES_NO_OPTION);
if(confirma ==JOptionPane.YES_OPTION){
// imprimir relatorio com frame
try {
JasperPrint imprimir= JasperFillManager.fillReport("C:/reports/Acampamentos.jasper",null,conexao);
// linha exibe relatorio
JasperViewer.viewReport(imprimir,false);
} catch (JRException e) {
JOptionPane.showMessageDialog(null, e);
}
}
}
Erro
Exception in thread “AWT-EventQueue-0” java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.(DefaultExtensionsRegistry.java:97)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
