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 )