net.sf.jasperreports.view.JasperViewer Java Examples
The following examples show how to use
net.sf.jasperreports.view.JasperViewer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ShikoPunetPunetoret.java From Automekanik with GNU General Public License v3.0 | 6 votes |
private void krijoRaport(String pnt){ btnRaporti.setOnAction(e -> { Thread t = new Thread(new Runnable() { @Override public void run() { try { Connection conn = DriverManager.getConnection(CON_STR, "test", "test"); HashMap hm = new HashMap(); hm.put("Folderi", folderi); hm.put("punetori", pnt); JasperReport jreport = JasperCompileManager.compileReport(raportiPunetor); JasperPrint jprint = JasperFillManager.fillReport(jreport, hm, conn); JasperViewer.viewReport(jprint, false); conn.close(); }catch (Exception ex){ex.printStackTrace();} } }); t.start(); }); }
Example #2
Source File: TeDhenat.java From Automekanik with GNU General Public License v3.0 | 6 votes |
private void raporti(String emri){ Thread t = new Thread(new Runnable() { @Override public void run() { try { Connection conn = DriverManager.getConnection(CON_STR, "test", "test"); HashMap hm = new HashMap(); hm.put("Folderi", folderi); hm.put("konsumatori", emri); JasperReport jreport = JasperCompileManager.compileReport(raporti2); JasperPrint jprint = JasperFillManager.fillReport(jreport, hm, conn); JasperViewer.viewReport(jprint, false); conn.close(); }catch (Exception ex){ex.printStackTrace();} } }); btnRaporti.setOnAction(e -> { t.start(); }); }
Example #3
Source File: JasperMain.java From chuidiang-ejemplos with GNU Lesser General Public License v3.0 | 6 votes |
public static void main(String[] args) throws JRException, ClassNotFoundException, SQLException { JasperReport report = JasperCompileManager.compileReport( "src/main/files/Blank_A4.jrxml"); Map<String,Object> parameters = new HashMap<>(); parameters.put("the_code","pepe2"); parameters.put("the_image","src/main/files/the_image.png"); Class.forName("org.postgresql.Driver"); Connection conn = null; conn = DriverManager.getConnection( "jdbc:postgresql://localhost/prueba","postgres", "postgres"); JasperPrint print = JasperFillManager.fillReport(report, parameters, conn); JasperExportManager.exportReportToPdfFile(print, "build/Blank_A4.pdf"); //Para visualizar el pdf directamente desde java JasperViewer.viewReport(print, false); }
Example #4
Source File: JasperReportExample.java From dctb-utfpr-2018-1 with Apache License 2.0 | 5 votes |
public void generate(String layout) throws JRException , SQLException, ClassNotFoundException{ //gerando o jasper design JasperDesign drawing = JRXmlLoader.load(layout); //compila o relatório JasperReport report = JasperCompileManager.compileReport(drawing); //estabelece conexão Class.forName(driver); Connection con = DriverManager.getConnection(url, user, password); Statement stm = con.createStatement(); String query = "SELECT * from java_item"; ResultSet rs = stm.executeQuery(query); //implementação da interface JRDataSource para DataSource ResultSet JRResultSetDataSource jrRS = new JRResultSetDataSource(rs); //executa o relatório Map params = new HashMap(); params.put("HEADER", "Relatório de Clientes"); params.put("FOOTER", "Final do Relatório - 2018 - UTFPR"); JasperPrint print = JasperFillManager.fillReport(report, params, jrRS); //exibe o resultado JasperViewer viewer = new JasperViewer(print, true); viewer.show(); }
Example #5
Source File: ShikoKonsumatoret.java From Automekanik with GNU General Public License v3.0 | 5 votes |
private void raporti(){ Thread t = new Thread(new Runnable() { @Override public void run() { try { Connection conn = DriverManager.getConnection(CON_STR, "test", "test"); JasperReport jreport = JasperCompileManager.compileReport(raporti); JasperPrint jprint = JasperFillManager.fillReport(jreport, new HashedMap(), conn); JasperViewer.viewReport(jprint, false); conn.close(); }catch (Exception ex){ex.printStackTrace();} } }); btnRaport.setOnAction(e -> t.start()); }
Example #6
Source File: ShikoPunetoret.java From Automekanik with GNU General Public License v3.0 | 5 votes |
private void raporti(){ new Thread(new Runnable() { @Override public void run() { try { Connection conn = DriverManager.getConnection(CON_STR, "test", "test"); JasperReport jreport = JasperCompileManager.compileReport(raporti); JasperPrint jprint = JasperFillManager.fillReport(jreport, new HashMap(), conn); JasperViewer.viewReport(jprint, false); conn.close(); }catch (Exception ex){ex.printStackTrace();} } }).start(); }
Example #7
Source File: VirtualizerApp.java From jasperreports with GNU Lesser General Public License v3.0 | 5 votes |
/** * */ public void view() throws JRException { JasperPrint jasperPrint = fillReport(); JasperViewer.viewReport(jasperPrint, true); }
Example #8
Source File: I18nApp.java From jasperreports with GNU Lesser General Public License v3.0 | 5 votes |
/** * */ public void view() throws JRException { Locale locale = chooseLocale(); if (locale != null) { JasperViewer.viewReport("build/reports/I18nReport.jrprint", false, true, locale); } }
Example #9
Source File: I18nApp.java From jasperreports with GNU Lesser General Public License v3.0 | 5 votes |
/** * */ public void viewXml() throws JRException { Locale locale = chooseLocale(); if (locale != null) { JasperViewer.viewReport("build/reports/I18nReport.jrpxml", true, true, locale); } }
Example #10
Source File: CustomVisualizationApp.java From jasperreports with GNU Lesser General Public License v3.0 | 4 votes |
/** * */ public void view() throws JRException { JasperViewer.viewReport("build/reports/LeafletMarkers.jrprint", false, true); }
Example #11
Source File: CustomVisualizationApp.java From jasperreports with GNU Lesser General Public License v3.0 | 4 votes |
/** * */ public void viewXml() throws JRException { JasperViewer.viewReport("build/reports/LeafletMarkers.jrpxml", true, true); }