From d285964c1d2caf88956b7a59d0c5010558833702 Mon Sep 17 00:00:00 2001 From: Frederico Palma Date: Tue, 4 Jan 2005 11:11:15 +0000 Subject: [PATCH] no message git-svn-id: https://svn.coded.pt/svn/SIPRP@148 bb69d46d-e84e-40c8-a05a-06db0d633741 --- trunk/siprp/Main.java | 2 +- trunk/siprp/ficha/ExamePDF.java | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/trunk/siprp/Main.java b/trunk/siprp/Main.java index 67c0f9be..118f2bc4 100644 --- a/trunk/siprp/Main.java +++ b/trunk/siprp/Main.java @@ -40,7 +40,7 @@ public class Main implements Connector Singleton.setInstance( SingletonConstants.COMPANY_NAME, "Centro Clínico Avenida" ); Singleton.setInstance( SingletonConstants.COMPANY_LOGO, "logo_evo.jpg" ); Singleton.setInstance( SingletonConstants.WEB_AWARE, Boolean.FALSE ); - Singleton.setInstance( SingletonConstants.DB_NAME, "shst2" ); + Singleton.setInstance( SingletonConstants.DB_NAME, "shst" ); dbase = (String)Singleton.getInstance( SingletonConstants.DB_NAME ); /* Calendar cal = Calendar.getInstance(); diff --git a/trunk/siprp/ficha/ExamePDF.java b/trunk/siprp/ficha/ExamePDF.java index f878290e..6b97425d 100644 --- a/trunk/siprp/ficha/ExamePDF.java +++ b/trunk/siprp/ficha/ExamePDF.java @@ -125,13 +125,22 @@ public class ExamePDF { public void print( byte []pdf ) throws Exception { - FileOutputStream fos = new FileOutputStream( System.getProperty( "user.home" ) + "\\report_ficha.pdf" ); + + FileOutputStream fos = new FileOutputStream( System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf" ); fos.write( pdf ); fos.close(); System.out.println( "File saved." ); - Process proc = Runtime.getRuntime().exec( "cmd.exe /c \"" + System.getProperty( "user.home" ) + "\\report_ficha.pdf\"" ); + Process proc; + if( System.getProperty( "os.name" ).startsWith( "Windows" ) ) + { + proc = Runtime.getRuntime().exec( "cmd.exe /c \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf\"" ); + } + else + { + proc = Runtime.getRuntime().exec( "open \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf\"" ); + } proc.waitFor(); - new File( System.getProperty( "user.home" ) + "\\report_ficha.pdf" ).delete(); + new File( System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf" ).delete(); } public byte[] createPDF( Hashtable values )