ï»??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产日韩综合久久精品,91久久电影,久久久久久a亚洲欧洲aⅴhttp://www.aygfsteel.com/kevinyao/zh-cnSat, 21 Jun 2025 04:22:09 GMTSat, 21 Jun 2025 04:22:09 GMT60WEB开发中水晶报表的ä‹É用心å¾?/title><link>http://www.aygfsteel.com/kevinyao/archive/2005/01/18/414.html</link><dc:creator>Kevin Yao</dc:creator><author>Kevin Yao</author><pubDate>Tue, 18 Jan 2005 00:48:00 GMT</pubDate><guid>http://www.aygfsteel.com/kevinyao/archive/2005/01/18/414.html</guid><wfw:comment>http://www.aygfsteel.com/kevinyao/comments/414.html</wfw:comment><comments>http://www.aygfsteel.com/kevinyao/archive/2005/01/18/414.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kevinyao/comments/commentRss/414.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kevinyao/services/trackbacks/414.html</trackback:ping><description><![CDATA[<P><STRONG><FONT size=1>[需求]</FONT></STRONG></P> <P><FONT size=1>最˜q‘在™å¹ç›®å¼€å‘过½E‹ä¸­åQŒå®¢æˆ¯‚¦æ±‚用Crystal Reports生成pdf格式的报表,òq¶å®žçŽ°è‡ªåŠ¨æ‰“å°åŠŸèƒ½ã€?/FONT></P> <P><STRONG><FONT size=1>[实施索引]</FONT></STRONG></P> <P><FONT size=1>1、创建水晶报表;</FONT></P> <P><FONT size=1>2、Java中利用报表组件包ž®†æŠ¥è¡¨ç»“果生成pdfåQ?/FONT></P> <P><FONT size=1>3、完成自动打印功能ã€?/FONT></P> <P><STRONG><FONT size=1>[详细步骤]</FONT></STRONG></P> <P><FONT size=1>1、创建水晶报è¡?/FONT></P> <P><FONT size=1>如果业务要求比较复杂åQŒè¦å…ˆåˆ›å»ÞZÍ时表和存储过½E‹ï¼Œå‡è®¾DB是ORACLEã€?/FONT></P> <P><FONT size=1>1.1、创å»ÞZÍ时表</FONT></P> <P><FONT size=1>CREATE  global TEMPORARY TABLE  <EM>table_name_temporary</EM><BR>(  ......... ) on commit preserve rows;</FONT></P> <P><FONT size=1>注:˜q™ç§æ–¹å¼¼‹®ä¿session之间åQŒæ•°æ®äº’不干扰ã€?/FONT></P> <P><FONT size=1>1.2、创建存储过½E?/FONT></P> <P><FONT size=1>创徏包体åQŒåŒ…体内声明游标ã€?/FONT></P> <P><FONT size=1>æ ÒŽ®ä¸šåŠ¡é€»è¾‘åQŒå°†æ•°æ®ä¿å­˜åœ¨äÍ时表中,˜q”回水晶报表所需要的¾l“果集ã€?/FONT></P> <P><FONT size=1>1.3、创建水晶报è¡?/FONT></P> <P><FONT size=1>以存储过½E‹åšä¸ºæ•°æ®æºåQŒåˆ›å»ºæ°´æ™¶æŠ¥è¡¨ã€?/FONT></P> <P><FONT size=1>2、Java中利用报表组件包ž®†æŠ¥è¡¨ç»“果生成pdf</FONT></P> <P><FONT size=1>       主要步骤如下åQ?/FONT></P> <P><FONT size=1>       åQ?åQ‰ç™»å½•CrystalEnterpriseåQ?/FONT></P> <P><FONT size=1>       åQ?åQ‰è®¾¾|®report参数åQŒæ£€ç´¢reportåQ?/FONT></P> <P><FONT size=1>      åQ?åQ‰ç™»å½•DB ServeråQ?/FONT></P> <P><FONT size=1>       åQ?åQ‰è¾“出结果到pdfã€?/FONT></P> <P><FONT size=1>        主要代码如下åQ?/FONT></P> <P><FONT size=1>       IEnterpriseSession enterpriseSession = null;<BR>          ReportClientDocument clientDoc = null;</FONT></P> <P><FONT size=1>            ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();<BR>            enterpriseSession = sessionMgr.logon(<BR>                    RAS_ADMINISTRATOR,<BR>                    RAS_ADMIN_PWD, RASServer,<BR>                    RAS_SEC);<BR>            IInfoStore iStore = (IInfoStore) enterpriseSession<BR>                    .getService(EAPTPrintConstants.RAS_INFOSTORE);<BR>            IReportAppFactory reportAppFactory = (IReportAppFactory) enterpriseSession<BR>                    .getService(EAPTPrintConstants.RAS_REPORT_FACTORY);<BR>            String query = "Select SI_ID From CI_INFOOBJECTS Where SI_NAME = '"<BR>                    + reportname + "' And SI_INSTANCE = 0 ";<BR>            IInfoObjects result = null;<BR>            try {<BR>                result = iStore.query(query);<BR>            } catch (SDKException e) {<BR>                e.printStackTrace();<BR>            }<BR>            IInfoObject firstResult = (IInfoObject) result.get(0);</FONT></P> <P><FONT size=1></FONT></P> <P><FONT size=1>            clientDoc = reportAppFactory.openDocument(firstResult, 0,<BR>                    Locale.ENGLISH);</FONT></P> <P><FONT size=1>            //logon to DataBase<BR>            DatabaseController db = clientDoc.getDatabaseController();</FONT></P> <P><FONT size=1>           // need to transfer arguments</FONT></P> <P><FONT size=1>            db.logonEx(dbServer, sid, username,<BR>                    password);</FONT></P> <P><FONT size=1>            clientDoc.refreshReportDocument();</FONT></P> <P><FONT size=1>            this.setParameters(clientDoc, map); </FONT></P> <P><FONT size=1>            ByteArrayInputStream byteIS = (ByteArrayInputStream) clientDoc<BR>                    .getPrintOutputController().export(ReportExportFormat.PDF);</FONT></P> <P><FONT size=1>            byte byteArray[] = new byte[byteIS.available()];<BR>            FileOutputStream fileOS = new FileOutputStream(filename);<BR>            ByteArrayOutputStream byteOS = new ByteArrayOutputStream(byteIS<BR>                    .available());<BR>            int x = byteIS.read(byteArray, 0, byteIS.available());<BR>            byteOS.write(byteArray, 0, x);<BR>            byteOS.writeTo(fileOS);<BR>            byteOS.close();<BR>            fileOS.close();</FONT></P> <P><FONT size=1>3、完成自动打印功èƒ?/FONT></P> <P><FONT size=1>      (1) åˆ©ç”¨Itext技术重新处理pdfåQŒåœ¨å·²ç”Ÿæˆçš„pdf里加上以下代码:</FONT></P> <P><FONT size=1>        String js = "var pp = this.getPrintParams();\n";<BR>        js = js + "var fv = pp.constants.flagValues;\n";<BR>        js = js + "pp.flags = fv.setPageSize;\n";<BR>        js = js + "pp.interactive = pp.constants.interactionLevel.automatic;\n";<BR>        js = js + "pp.printerName = \"" + printer + "\";\n";<BR>        js = js + "this.print(pp);\n";</FONT></P> <P><FONT size=1>      (2)jsp中需要IFrame标签åQŒç„¶åŽè‡ªåŠ¨è°ƒç”¨ServletåQŒåœ¨servlet里将pdf输出来,直接输出到打印机上ã€?/FONT></P><img src ="http://www.aygfsteel.com/kevinyao/aggbug/414.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kevinyao/" target="_blank">Kevin Yao</a> 2005-01-18 08:48 <a href="http://www.aygfsteel.com/kevinyao/archive/2005/01/18/414.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> Ö÷Õ¾Ö©Öë³ØÄ£°å£º <a href="http://" target="_blank">º£°²ÏØ</a>| <a href="http://" target="_blank">ÒËÖÝÊÐ</a>| <a href="http://" target="_blank">°×ÓñÏØ</a>| <a href="http://" target="_blank">¶«³ÇÇø</a>| <a href="http://" target="_blank">ÍòÊ¢Çø</a>| <a href="http://" target="_blank">±¾Ïª</a>| <a href="http://" target="_blank">º£ÁÖÊÐ</a>| <a href="http://" target="_blank">ÔÆ¸¡ÊÐ</a>| <a href="http://" target="_blank">¹óÑôÊÐ</a>| <a href="http://" target="_blank">Åî°²ÏØ</a>| <a href="http://" target="_blank">ºÏ½­ÏØ</a>| <a href="http://" target="_blank">ÓôÄÏÏØ</a>| <a href="http://" target="_blank">ÖÐɽÊÐ</a>| <a href="http://" target="_blank">ÑÓÇìÏØ</a>| <a href="http://" target="_blank">ÆÑ³ÇÏØ</a>| <a href="http://" target="_blank">¶îÃôÏØ</a>| <a href="http://" target="_blank">¾°¶«</a>| <a href="http://" target="_blank">²ìÓçÏØ</a>| <a href="http://" target="_blank">ƽÄÏÏØ</a>| <a href="http://" target="_blank">¶¨ÄÏÏØ</a>| <a href="http://" target="_blank">º¼½õºóÆì</a>| <a href="http://" target="_blank">ÇØ»ÊµºÊÐ</a>| <a href="http://" target="_blank">ÎÚÇ¡ÏØ</a>| <a href="http://" target="_blank">´óͬÊÐ</a>| <a href="http://" target="_blank">ÌïÁÖÏØ</a>| <a href="http://" target="_blank">´ó¸ÛÇø</a>| <a href="http://" target="_blank">лͨÃÅÏØ</a>| <a href="http://" target="_blank">¾äÈÝÊÐ</a>| <a href="http://" target="_blank">Àû½òÏØ</a>| <a href="http://" target="_blank">ÁùÅÌË®ÊÐ</a>| <a href="http://" target="_blank">¹¢Âí</a>| <a href="http://" target="_blank">¾¸½­ÊÐ</a>| <a href="http://" target="_blank">×ϽðÏØ</a>| <a href="http://" target="_blank">ÒÍÁ¼ÏØ</a>| <a href="http://" target="_blank">Õý¶¨ÏØ</a>| <a href="http://" target="_blank">¾ÞÂ¹ÏØ</a>| <a href="http://" target="_blank">ÁÖ¿ÚÏØ</a>| <a href="http://" target="_blank">ÐÂç­ÏØ</a>| <a href="http://" target="_blank">Ã÷Ë®ÏØ</a>| <a href="http://" target="_blank">Å®ÐÔ</a>| <a href="http://" target="_blank">ÇåºÓÏØ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>