OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 174
Line 25... Line 25...
25
import org.openconcerto.sql.Configuration;
25
import org.openconcerto.sql.Configuration;
26
import org.openconcerto.sql.model.SQLRow;
26
import org.openconcerto.sql.model.SQLRow;
27
import org.openconcerto.utils.ExceptionHandler;
27
import org.openconcerto.utils.ExceptionHandler;
28
import org.openconcerto.utils.FileUtils;
28
import org.openconcerto.utils.FileUtils;
29
 
29
 
-
 
30
import java.awt.print.PrinterJob;
30
import java.io.BufferedInputStream;
31
import java.io.BufferedInputStream;
31
import java.io.File;
32
import java.io.File;
32
import java.io.FileNotFoundException;
33
import java.io.FileNotFoundException;
33
import java.io.IOException;
34
import java.io.IOException;
34
import java.io.InputStream;
35
import java.io.InputStream;
Line 243... Line 244...
243
                final OOConnexion ooConnexion = ComptaPropsConfiguration.getOOConnexion();
244
                final OOConnexion ooConnexion = ComptaPropsConfiguration.getOOConnexion();
244
                if (ooConnexion == null) {
245
                if (ooConnexion == null) {
245
                    return;
246
                    return;
246
                }
247
                }
247
                final Component doc = ooConnexion.loadDocument(fileOutOO, true);
248
                final Component doc = ooConnexion.loadDocument(fileOutOO, true);
-
 
249
                if (this.printer != null && this.printer.trim().length() > 0) {
248
                Map<String, Object> map = new HashMap<String, Object>();
250
                    Map<String, Object> map = new HashMap<String, Object>();
249
                map.put("Name", printer);
251
                    map.put("Name", this.printer);
250
                doc.printDocument(map);
252
                    doc.printDocument(map);
-
 
253
                } else {
-
 
254
                    doc.printDocument(PrinterJob.getPrinterJob());
-
 
255
                }
251
                doc.close();
256
                doc.close();
252
            } catch (LinkageError e) {
257
            } catch (LinkageError e) {
253
                JOptionPane.showMessageDialog(new JFrame(), "Merci d'installer OpenOffice ou LibreOffice");
258
                JOptionPane.showMessageDialog(new JFrame(), "Merci d'installer OpenOffice ou LibreOffice");
254
            } catch (Exception e) {
259
            } catch (Exception e) {
255
                e.printStackTrace();
260
                e.printStackTrace();