SHARE
TWEET

Untitled

a guest Jun 25th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void btnReporteUsuarioActionPerformed(java.awt.event.ActionEvent evt) {                                                  
  2.     // TODO add your handling code here:
  3.     List lista = new ArrayList();
  4.     for(int i=0; i<tblListCom.getRowCount(); i++){
  5.         ListaUser user= new ListaUser(tblListCom.getValueAt(i, 9).toString(),tblListCom.getValueAt(i,4 ).toString(),tblListCom.getValueAt(i, 3).toString(),tblListCom.getValueAt(i, 2).toString(),tblListCom.getValueAt(i, 8).toString());
  6.         lista.add(user);        
  7.         }
  8.  
  9.  try {
  10.      JasperReport reporte = (JasperReport) JRLoader.loadObject("reporteuser.jasper");
  11.       Map parametro = new HashMap();
  12.         parametro.put("hostname",txtHost_com.getText());
  13.         JasperPrint jprint = JasperFillManager.fillReport(reporte, parametro,new JRBeanCollectionDataSource(lista));
  14.         JasperViewer.viewReport(jprint);
  15.  } catch (JRException ex) {
  16.      Logger.getLogger(ListCompu.class.getName()).log(Level.SEVERE, null, ex);
  17.  }
  18.  
  19. }
  20.      
  21. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
  22. at Ventanas.ListCompu.btnReporteUsuarioActionPerformed(ListCompu.java:935)
  23. at Ventanas.ListCompu.access$1400(ListCompu.java:47)
  24. at Ventanas.ListCompu$15.actionPerformed(ListCompu.java:444)
  25. at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
  26. at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
  27. at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
  28. at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
  29. at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
  30. at java.awt.Component.processMouseEvent(Component.java:6533)
  31. at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
  32. at java.awt.Component.processEvent(Component.java:6298)
  33. at java.awt.Container.processEvent(Container.java:2236)
  34. at java.awt.Component.dispatchEventImpl(Component.java:4889)
  35. at java.awt.Container.dispatchEventImpl(Container.java:2294)
  36. at java.awt.Component.dispatchEvent(Component.java:4711)
  37. at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
  38. at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
  39. at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
  40. at java.awt.Container.dispatchEventImpl(Container.java:2280)
  41. at java.awt.Window.dispatchEventImpl(Window.java:2746)
  42. at java.awt.Component.dispatchEvent(Component.java:4711)
  43. at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
  44. at java.awt.EventQueue.access$500(EventQueue.java:97)
  45. at java.awt.EventQueue$3.run(EventQueue.java:709)
  46. at java.awt.EventQueue$3.run(EventQueue.java:703)
  47. at java.security.AccessController.doPrivileged(Native Method)
  48. at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
  49. at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
  50. at java.awt.EventQueue$4.run(EventQueue.java:731)
  51. at java.awt.EventQueue$4.run(EventQueue.java:729)
  52. at java.security.AccessController.doPrivileged(Native Method)
  53. at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
  54. at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
  55. at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
  56. at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
  57. at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
  58. at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
  59. at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
  60. at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
  61.      
  62. ListaUser user= new ListaUser(tblListCom.getValueAt(i, 9).toString(),tblListCom.getValueAt(i,4 ).toString(),tblListCom.getValueAt(i, 3).toString(),tblListCom.getValueAt(i, 2).toString(),tblListCom.getValueAt(i, 8).toString());
  63.      
  64. public class ListaUser {
  65. private String Nomina;
  66. private String Equipo;
  67. private String Marca;
  68. private String Modelo;
  69. private String SN;
  70. private String Comentarios;
  71.  
  72. public ListaUser(String Nomina, String Equipo, String Marca, String Modelo, String SN, String Comentarios) {
  73.     this.Nomina = Nomina;
  74.     this.Equipo = Equipo;
  75.     this.Marca = Marca;
  76.     this.Modelo = Modelo;
  77.     this.SN = SN;
  78.     this.Comentarios = Comentarios;
  79. }
  80.  
  81. public ListaUser(String toString, String toString0, String toString1, String toString2, String toString3) {
  82.     throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  83. }
  84.  
  85.  
  86.  
  87.  
  88. public String getNomina() {
  89.     return Nomina;
  90. }
  91.  
  92. public void setNomina(String Nomina) {
  93.     this.Nomina = Nomina;
  94. }
  95.  
  96. public String getEquipo() {
  97.     return Equipo;
  98. }
  99.  
  100. public void setEquipo(String Equipo) {
  101.     this.Equipo = Equipo;
  102. }
  103.  
  104. public String getMarca() {
  105.     return Marca;
  106. }
  107.  
  108. public void setMarca(String Marca) {
  109.     this.Marca = Marca;
  110. }
  111.  
  112. public String getModelo() {
  113.     return Modelo;
  114. }
  115.  
  116. public void setModelo(String Modelo) {
  117.     this.Modelo = Modelo;
  118. }
  119.  
  120. public String getSN() {
  121.     return SN;
  122. }
  123.  
  124. public void setSN(String SN) {
  125.     this.SN = SN;
  126. }
  127.  
  128. public String getComentarios() {
  129.     return Comentarios;
  130. }
  131.  
  132. public void setComentarios(String Comentarios) {
  133.     this.Comentarios = Comentarios;
  134. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top