Foros del Web » Programación para mayores de 30 ;) » Java »

Ayuda con reportes java

Estas en el tema de Ayuda con reportes java en el foro de Java en Foros del Web. Hola, lo que quiero hacer es una serie de reportes con datos provenientes de un BD pero bajadas a un ArrayList, lei que tenia que ...
  #1 (permalink)  
Antiguo 20/01/2010, 15:34
 
Fecha de Ingreso: enero-2010
Mensajes: 1
Antigüedad: 14 años, 3 meses
Puntos: 0
Ayuda con reportes java

Hola, lo que quiero hacer es una serie de reportes con datos provenientes de un BD pero bajadas a un ArrayList, lei que tenia que importar los jar jasperreports y DinamicJasper creo que con eso no tengo problemas, lo que hice hasta ahora es esto:



//LA CLASE LISTADO SOCIOS

public class ListadoSocios extends BaseDjReportTest {

public ListadoSocios(){

}

public DynamicReport buildReport() throws Exception {

FastReportBuilder drb = new FastReportBuilder();
Date fechaActual = new Date();
SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");
String cadenaFecha = formato.format(fechaActual);


drb.addColumn("Apellido", "apellido", String.class.getName(),20)
.addColumn("Nombre", "nombre", String.class.getName(),20)
.addColumn("Direccion", "direccion", String.class.getName(),20)
.addColumn("Telefono", "telefono", String.class.getName(),10)
.setTitle("LISTADO SOCIOS")
.setSubtitle("Reporte generado el dia: " + cadenaFecha)
.setUseFullPageWidth(true);

DynamicReport dr = drb.build();

return dr;
}





}

///************************************************** ***********///


public class PruebaReportes extends JFrame {

private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JButton jButtonReporte = null;
/**
* This is the default constructor
*/
public PruebaReportes() {
super();
initialize();
}

/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(300, 200);
this.setContentPane(getJContentPane());
this.setTitle("JFrame");
}

/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(getJButtonReporte(), null);
}
return jContentPane;
}

/**
* This method initializes jButtonReporte
*
* @return javax.swing.JButton
*/
private JButton getJButtonReporte() {
if (jButtonReporte == null) {
jButtonReporte = new JButton();
jButtonReporte.setBounds(new Rectangle(66, 36, 145, 79));
jButtonReporte.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
ListadoSocios(e);

}
});
}
return jButtonReporte;
}

protected void ListadoSocios(ActionEvent e){
ListadoSocios test = new ListadoSocios(); //aca me tira el error algo de java.lang.NoClassDefFoundError:


JRDataSource ds = new JRBeanCollectionDataSource(ControladorVideo.retorn arSocios());
JasperPrint jp=null;
try {
jp = DynamicJasperHelper.generateJasperPrint(test.build Report(), new ClassicLayoutManager(), ds);
} catch (JRException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
JasperViewer.viewReport(jp,false);


}

public static void main (String[] args){
PruebaReportes vent = new PruebaReportes();
vent.setVisible(true);
}


}

// al ejecutar el main me tira un error en el constructor

// si hay algo mal o me falta algo por favor haganmelo saber

gracias.

Etiquetas: reporte
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:16.