Guest User

Untitled

a guest
Nov 28th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. public void ReporteVenta() throws SQLException,JRException, ClassNotFoundException{
  2. Class.forName("com.mysql.jdbc.Driver");
  3. Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/proyecto7c", "root", "*****");
  4. JasperReport report;
  5. report = (JasperReport) JRLoader.loadObjectFromFile("C:\Users\pc\Documents\NetBeansProjects\proyecto7mo\src\Reportes\ReporteVentas.jasper");
  6. JasperPrint im=JasperFillManager.fillReport(report,null,conexion);
  7. JasperViewer ver=new JasperViewer(im);
  8. ver.setTitle("Ticket de venta");
  9. ver.setVisible(true);
  10. }
  11.  
  12. > no suitable method found for
  13. > fillReport(JasperReport,Map<String,String>,Connection)
  14. > method JasperFillManager.fillReport(String,Map<String,Object>,Connection) is
  15. > not applicable
  16. > (argument mismatch; JasperReport cannot be converted to String)
  17.  
  18. public void ReporteVenta(String idVenta) throws SQLException,JRException, ClassNotFoundException{
  19. Map<String, String> parametros;
  20. parametros = new HashMap<>();
  21. parametros.put("IdVenta", idVenta);
  22. Class.forName("com.mysql.jdbc.Driver");
  23. Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/proyecto7c", "root", "****");
  24. JasperReport report;
  25. report = (JasperReport) JRLoader.loadObjectFromFile("C:\Users\pc\Documents\NetBeansProjects\proyecto7mo\src\Reportes\ReporteVentas_1.jasper");
  26. JasperPrint im;
  27. im = JasperFillManager.fillReport(report,parametros, conexion);//aquí me muestra ese mensaje
  28. JasperViewer ver=new JasperViewer(im);
  29. ver.setTitle("Ticket de venta");
  30. ver.setVisible(true);
  31. }
Add Comment
Please, Sign In to add comment