ï»??xml version="1.0" encoding="utf-8" standalone="yes"?>狠狠色丁香久久综合频道 ,高清国产午夜精品久久久久久,国产女人在线视频http://www.aygfsteel.com/kevinyao/zh-cnTue, 08 Jul 2025 16:41:47 GMTTue, 08 Jul 2025 16:41:47 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">ÁijÇÊÐ</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>