10 Replies Latest reply: Apr 24, 2008 8:49 AM by 800322 RSS

    How to open the excel file using poi


      In my application, im having a export button. On clicking, it exports the JTable to excel file. I have exported the JTable to excel and it was saved in my workspace but not opening excel on clicking the button. I have used poi2.5.1.jar to customize the excel

      I want to open the Excel file on clicking the export button. Please help me out.

       public void exportTable() { // export Table
           try {
                System.out.println("Exporting Table ");
                HSSFWorkbook wb = new HSSFWorkbook();
                HSSFSheet sheet = wb.createSheet("spreadSheet");
                HSSFRow row = sheet.createRow((short)1);
                FileOutputStream fileOut = new FileOutputStream("Calculation"+ System.currentTimeMillis()+".xls");
           } catch (Exception E) {
                System.out.println("Error While Exporting Table " + E);
            private void open(FileOutputStream f) {
                  String[] commands = {"rundll32","url.dll,FileProtocolHandler"};
                try {
                } catch (IOException e) {