Saturday, March 28, 2020

Cara Setting iReport, Print & web


Cara setting beberapa permasalahan yang terjadi, supaya semua berjalan dengan baik :

1. Cara setting ireport pada OS 64bit supaya bisa berjalan dengan baik.

2. Cara Setting Email : gmail agar bisa mengirimkan email melalui program yang dibuat sendiri
    pilih toos --> keamanan ( security )
 

   
   Aktifkan : Izinkan aplikasi yang kurang aman
 


3. Cara setting Printer Epson Termal T82 agar bisa dishare :
    jika saat share printer keluar error :
 
 







   buka : service.msc
    lalu klik kanan --> properties
   disabled jadikan automatis, lalu start


    setelah itu silahkan dishare lagi.

4. cara  setting opera supaya tidak muncul new tab, jadi single tab saat dibuka link itu aja saat diklik
   pertama buat link web atau program :
 





















setelah dibuat : di tarik ke desktop




setting opera single tab saat dibuka :

Function Java Cashdrawer & Direct Print with web

Function Untuk mencetak langsung ke printer dan langsung membuka cashdrawer box kasir
 

 public void f_cashdrawer(String printer_name) {     
        // sesuaikan dengan tipe printer termal
        byte[] open = {27, 112, 0, 25, (byte)251};
        String printer = PrinterName;
        PrintServiceAttributeSet printserviceattributeset = new HashPrintServiceAttributeSet();
        printserviceattributeset.add(new PrinterName(printer,null));
        PrintService[] printservice = PrintServiceLookup.lookupPrintServices(null, printserviceattributeset);
        if(printservice.length!=1){
            System.out.println("Printer not found");
        }
        PrintService pservice = printservice[0];
        DocPrintJob job = pservice.createPrintJob();
        DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
        Doc doc = new SimpleDoc(open,flavor,null);
        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
        try {
            job.print(doc, aset);
        } catch (PrintException ex) {
            System.out.println(ex.getMessage());
        }
    }

public void f_print(String v_filepdf, String v_nama_printer) throws FileNotFoundException, IOException {             
        DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
        PrintService[] services = PrintServiceLookup.lookupPrintServices(flavor, null);
        FileInputStream psStream = null;
        try {
             //   misal :   psStream = new FileInputStream("d:\\test.pdf");
            psStream = new FileInputStream(v_filepdf);
            } catch (FileNotFoundException ffne) {
              ffne.printStackTrace();
            }
        if (psStream == null) {
            return;
        }     
        if (services.length > 0)
        {
            PrintService myService = null;
            for(PrintService service : services) {
                System.out.println(service.getName());
                if(service.getName().contains(v_nama_printer)) {
                // misal : if(service.getName().contains("Epson AL-2600")) {
                    myService = service;
                    break;
                }
            }
            DocPrintJob printJob = myService.createPrintJob();
            Doc document = new SimpleDoc(psStream, flavor, null);
            try {
                printJob.print(document, null);
            } catch (PrintException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        else
        {
            System.out.println("No PDF printer available.");
        }     
       // cashdrawerOpen(v_nama_printer);
    }

Memunculkan Simbol & Emoji Pada OS Mac

  Memunculkan Simbol & Emoji  1. Buka aplikasi Pages / Notes pada Macbook. 2. Klik pada Menubar Edit --> Pilih Emoji and Symbols a...