octscorpion

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            0 Posts :: 17 Stories :: 0 Comments :: 0 Trackbacks
            public static void excelPrint(String filePath) {
                  ActiveXComponent xl 
          = new ActiveXComponent("Excel.Application");
                  
          try {

                      Dispatch.put(xl, 
          "Visible"new Variant(false));
                      Dispatch workbooks 
          = xl.getProperty("Workbooks").toDispatch();
                      Dispatch ex 
          = Dispatch.call(workbooks, "Open", filePath).toDispatch();
                      Dispatch.get(ex, 
          "PrintOut");
                  }
           catch (Exception e) {
                      e.printStackTrace();
                  }
           finally {
                      xl.invoke(
          "Quit"new Variant[] {});
                      xl 
          = null;

                  }


              }
          posted on 2012-12-12 17:38 一G刀客 閱讀(296) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 青冈县| 灌阳县| 台山市| 盈江县| 余干县| 伊宁县| 宁晋县| 老河口市| 定兴县| 堆龙德庆县| 桂东县| 扎囊县| 盐源县| 西贡区| 邮箱| 油尖旺区| 犍为县| 罗定市| 连城县| 财经| 阿勒泰市| 岳池县| 雷波县| 虹口区| 门源| 凌云县| 河南省| 旬阳县| 平远县| 晋州市| 昌宁县| 绥中县| 资中县| 屏东县| 林口县| 永昌县| 阳泉市| 霸州市| 柏乡县| 高阳县| 巩留县|