请教一个jcom问题!有木有高手啊?
java吧
全部回复
仅看楼主
level 1
dm61617 楼主
使用jcom在tomcat项目上实现打印预览的功能。在MyEclipse上运行正常看,但发布到tomcat上运行不了了。代码如下:
public ActionForward tostamp(ActionMapping mapping, ActionForm form,
             HttpServletRequest request, HttpServletResponse response){
         logger.info("tostamp getDownload method start");
         ReleaseManager rm = new ReleaseManager();
         condition = new HashMap();//初始化HASHMAP
         downloadtabledataForm = (DownloadTableDataForm)form;//取得FROM
         menuFlg = Utility.nullToString(request.getParameter("menuFlg"));//取得数据来源
         try {
             // 取得项目路径
             String path = servlet.getServletContext().getRealPath(File.separator);
            
             String tos1 = Utility.nullToString(request.getParameter("tos1"));
             String tos2 = Utility.nullToString(request.getParameter("tos2"));
             String tos3 = Utility.nullToString(request.getParameter("tos3"));
             String tos4 = Utility.nullToString(request.getParameter("tos4"));
             String tos5 = Utility.nullToString(request.getParameter("tos5"));
            
             Map maps = new HashMap();
             maps.clear();
             maps.put("tos1", tos1);
             maps.put("tos2", tos2);
             maps.put("tos3", tos3);
             maps.put("tos4", tos4);
             maps.put("tos5", tos5);
            
             String fileUrl = path + File.separator + CommConst.fileMYDownload + File.separator
                 + CommConst.fileMYSubDownload + File.separator + "moban.xls";

2011年06月24日 08点06分 1
level 1
dm61617 楼主
            
             this.setxls(fileUrl, maps);
            
             logger.info("tostamp getDownload method 1");
            
             ExcelApplication excel = new ExcelApplication(rm);
            
             logger.info("tostamp getDownload method 2");
            
             ExcelWorkbooks xlBooks = excel.Workbooks();
            
             logger.info("tostamp getDownload method 3");
            
             ExcelWorkbook xlBook = xlBooks.Open(fileUrl);
            
             logger.info("tostamp getDownload method 4");
            
             ExcelWorksheet xlSheet = excel.ActiveSheet();
            
             logger.info("tostamp getDownload method 5");
             excel.Visible(true);
            
             logger.info("tostamp getDownload method 6");
            
             xlSheet.PrintOut(1,1,1,true);
            
             logger.info("tostamp getDownload method 7");
            
             xlBook.Close(false, null, false);
            
             logger.info("tostamp getDownload method 8");
            
             excel.Quit();
            
         }catch (Exception e) {//抛异常
             e.printStackTrace();
             request.setAttribute("messageFlg", "ERR");
             return mapping.findForward("research");
         }finally{
             condition = null;
             downloadtabledataForm = null;
             menuFlg = null;
             rm.release();
         }
         logger.info("tostamp getDownload method end");
         return null;
     }
经log判断,是在执行“xlSheet.PrintOut(1,1,1,true);”时卡住了,求高手解救!
2011年06月24日 08点06分 2
level 1
dm61617 楼主
无人问津啊
2011年06月27日 01点06分 3
1