Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ReporteVenta() throws SQLException,JRException, ClassNotFoundException{
- Class.forName("com.mysql.jdbc.Driver");
- Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/proyecto7c", "root", "*****");
- JasperReport report;
- report = (JasperReport) JRLoader.loadObjectFromFile("C:\Users\pc\Documents\NetBeansProjects\proyecto7mo\src\Reportes\ReporteVentas.jasper");
- JasperPrint im=JasperFillManager.fillReport(report,null,conexion);
- JasperViewer ver=new JasperViewer(im);
- ver.setTitle("Ticket de venta");
- ver.setVisible(true);
- }
- > no suitable method found for
- > fillReport(JasperReport,Map<String,String>,Connection)
- > method JasperFillManager.fillReport(String,Map<String,Object>,Connection) is
- > not applicable
- > (argument mismatch; JasperReport cannot be converted to String)
- public void ReporteVenta(String idVenta) throws SQLException,JRException, ClassNotFoundException{
- Map<String, String> parametros;
- parametros = new HashMap<>();
- parametros.put("IdVenta", idVenta);
- Class.forName("com.mysql.jdbc.Driver");
- Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/proyecto7c", "root", "****");
- JasperReport report;
- report = (JasperReport) JRLoader.loadObjectFromFile("C:\Users\pc\Documents\NetBeansProjects\proyecto7mo\src\Reportes\ReporteVentas_1.jasper");
- JasperPrint im;
- im = JasperFillManager.fillReport(report,parametros, conexion);//aquí me muestra ese mensaje
- JasperViewer ver=new JasperViewer(im);
- ver.setTitle("Ticket de venta");
- ver.setVisible(true);
- }
Add Comment
Please, Sign In to add comment