Java - Problema con Jasper Report

 
Vista:
sin imagen de perfil

Problema con Jasper Report

Publicado por Ivan (3 intervenciones) el 04/06/2018 23:46:58
Hola.
Tengo un problema con la impresión de mi reporte, cuando exporto a PDF y luego imprimo sale correctamente, pero cuando lo hago desde la vista previa de Jasper (donde se ve bien) reduce el tamaño.
con el siguiente código llamo al reporte:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
try //throws JRException, Exception
{
    Padre.Conexion con= new Padre.Conexion();
    Connection conex = con.getConnection();
    Statement st;
    java.sql.ResultSet rs;
    String sql="SELECT * from vista_presupuesto, vista_presupuesto_detalle where vista_presupuesto.id_venta=1 and vista_presupuesto_detalle.id_cabecera=1";
    st=(Statement) conex.createStatement(); //aqui creamos la estructura de ejecucion
    rs=st.executeQuery(sql);
    JRResultSetDataSource jrRS = new JRResultSetDataSource(rs);
    HashMap<String, Object> parametros = new HashMap();
    parametros.put("prueba_p", 3);
    java.net.URL urlMaestro = getClass().getClassLoader().getResource("reporte/Presupuesto.jasper");
    // Cargamos el reporte
    JasperReport masterReport = null;
    masterReport = (JasperReport) JRLoader.loadObject(urlMaestro);
    JasperPrint masterPrint = null;
    masterPrint = JasperFillManager.fillReport(masterReport, parametros, jrRS);
    JasperViewer ventana = new JasperViewer(masterPrint, false);
    ventana.setTitle("Presupuesto");
    ventana.setVisible(true);
 
} catch (JRException ex) {
    // Logger.getLogger(Informes.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
    // Logger.getLogger(Informes.class.getName()).log(Level.SEVERE, null, ex);
}
boleta
vista_previa
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder