锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久久久久综合,在线日韩一区二区,99久久精品免费看国产一区二区三区 http://www.aygfsteel.com/pdw2009/category/27001.htmlJ2EE鐩稿叧搴旂敤鎶鏈棩蹇?/description>zh-cnWed, 05 Dec 2007 01:47:50 GMTWed, 05 Dec 2007 01:47:50 GMT60VML 瀛︿範(fàn)http://www.aygfsteel.com/pdw2009/archive/2007/12/04/165149.html鏈夌尗鐩鎬即鐨勬棩瀛?/dc:creator>鏈夌尗鐩鎬即鐨勬棩瀛?/author>Tue, 04 Dec 2007 05:35:00 GMThttp://www.aygfsteel.com/pdw2009/archive/2007/12/04/165149.htmlhttp://www.aygfsteel.com/pdw2009/comments/165149.htmlhttp://www.aygfsteel.com/pdw2009/archive/2007/12/04/165149.html#Feedback0http://www.aygfsteel.com/pdw2009/comments/commentRss/165149.htmlhttp://www.aygfsteel.com/pdw2009/services/trackbacks/165149.html
灞炴у悕 榛樿鍊?/td> 鍊肩被鍨?鑼冨洿 鐢ㄩ?/td>
strokeweight 0.75pt=1px number 鎻忚堪鍥懼艦鐨勮竟妗嗙矖搴?/td>
strokecolor black color 鎻忚堪鍥懼艦鐨勮竟妗嗛鑹?/td>
stroked true boolean 鎻忚堪鍥懼艦鏄惁浣跨敤杈規(guī)
fillcolor white color 鎻忚堪鍥懼艦鐨勮儗鏅鑹?/td>
filled true boolean 鎻忚堪鍥懼艦鏄惁浣跨敤鑳屾櫙
print true boolean 鎻忚堪鍥懼艦鏄惁鍏佽琚墦鍗版満鎵撳嵃
coordsize 1000,1000 Vector2D 鏆楃ず鍥懼艦涓庡鍣ㄧ┖闂寸殑澶у皬姣斾緥
coordorigin 0 0 Vector2D coordinate at top-left corner of element
wrapcoords null string outline to use for tight text wrapping
2銆乂ML鏍囪鏀寔鐨凥TML閫氱敤灞炴?br />
灞炴у悕 榛樿鍊?/td> 鍊肩被鍨?鑼冨洿 鐢ㄩ?/td>
id null string 瀹氫箟鍏冪礌鐨勬爣璇嗙儲寮?澶氱敤浜嶥HTML緙栫▼)
class null classname 瀹氫箟鍏冪礌浣跨敤鐨凜SS鏍峰紡綾?/td>
style null CSS string 鎻忚堪鍥懼艦鐨凜SS鏍峰紡琛?/td>
title null string 瀹氫箟鍥懼艦鐨勬彁紺烘爣棰?榧犳爣闈犺繎鍚庣殑甯姪鎻愮ず)
href null string 瀹氫箟鍥懼艦閾炬帴鐨刄RL鍦板潃
target _self _self/_blank/_top 瀹氫箟鍥懼艦浠ヤ綍縐嶅艦寮忔墦寮閾炬帴
contentEditable false boolean 鎻忚堪鍥懼艦鍐呭鏄惁鍏佽鐢ㄦ埛緙栬緫
dir ltr ltr/rtl 鎻忚堪鍥懼艦鍐呭浠ュ摢縐嶆柟鍚戣緭鍑?/td>
disabled false boolean 鎻忚堪鍥懼艦鑳藉鍝嶅簲鐢ㄦ埛浜嬩歡瑙﹀彂
3銆乂ML鏍囪鏀寔鐨凜SS閫氱敤灞炴?br />
灞炴у悕 鍙敤鍊?鍙敤鍊艱寖鍥?/td> 鐢ㄩ?/td>
width 0-9999 鎻忚堪瀹藉害
height 0-9999 鎻忚堪楂樺害
position static absolute fixed relative 鎻忚堪濡備綍瀹氫綅杈撳嚭
left 0-9999 鎻忚堪璺濈欏甸潰浣嶇疆宸?/td>
top 0-9999 鎻忚堪璺濈欏甸潰浣嶇疆涓?/td>
z-index 0-9999 鎻忚堪3D浣嶇疆
cursor auto crosshair hand move help wait text…… 鎻忚堪榧犳爣褰㈢姸
zoom 0-99 鎻忚堪緙╂斁姣斾緥
clip rect(涓?鍙?涓?宸? 鎻忚堪瑁佸壀瀵硅薄
border 0-99 style color 鎻忚堪杈規(guī)
display block none inline list-item 鎻忚堪鏄劇ず鎴栭殣钘?/td>
overflow visible auto hidden scroll 鎻忚堪婊氬姩鏉?/td>
color colorstring 鎻忚堪鏂囨湰鍐呭棰滆壊
font-size 0-999 鎻忚堪鏂囨湰鍐呭瀛楀彿
filter xray flipv fliph invert alpha(opacity=num) 鎻忚堪婊ら暅鏁堟灉
rotation (0-9999)%360 鎻忚堪鏃嬭漿搴?/td>
flip x y 鎻忚堪鍙嶈漿鎴栭鍊掑浘褰?/td>




]]>
jasperreport浣跨敤list杈撳嚭http://www.aygfsteel.com/pdw2009/archive/2007/11/01/157570.html鏈夌尗鐩鎬即鐨勬棩瀛?/dc:creator>鏈夌尗鐩鎬即鐨勬棩瀛?/author>Thu, 01 Nov 2007 10:19:00 GMThttp://www.aygfsteel.com/pdw2009/archive/2007/11/01/157570.htmlhttp://www.aygfsteel.com/pdw2009/comments/157570.htmlhttp://www.aygfsteel.com/pdw2009/archive/2007/11/01/157570.html#Feedback0http://www.aygfsteel.com/pdw2009/comments/commentRss/157570.htmlhttp://www.aygfsteel.com/pdw2009/services/trackbacks/157570.htmljasperreport涓彲浠ヤ嬌鐢↙ist浣滀負(fù)鏁版嵁婧愶紝浣跨敤鏍煎紡濡備笅.
List list=this.customerDao.getAllCustomer();  //寰楀埌鎵鏈夊鎴?br /> JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
   JasperPrint jasperPrint = JasperFillManager.fillReport(
     reportFilePath, parameters, ds);
寰楀~鍏呮暟鎹悗錛屽嵆鍙緭鍑烘樉紺哄埌PDF,Excel,Html
鍒癙DF:
public byte[] generatePDF(String begCustNo, String endCustNo,
   String reportTitle, String reportFilePath) throws DemoException {
  // TODO Auto-generated method stub
 //begCustNo,endCustNo鍒嗗埆涓烘煡璇紶鍏ョ殑寮濮嬬紪鍙鳳紝緇撴潫緙栧彿.
  jdbcCustomerDao = new JdbcCustomerDao();
  Map parameters = new HashMap();
  parameters.put("ReportTitle", reportTitle);//鎶ヨ〃鏍囬
  List list = jdbcCustomerDao.getAllCustomer(begCustNo, endCustNo);
   try {
   JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
   JasperPrint jasperPrint = JasperFillManager.fillReport(
     reportFilePath, parameters, ds);   return JasperExportManager.exportReportToPdf(jasperPrint);
  } catch (JRException e) {
   throw new DemoException("Report Export Failed.");
  }
 }
鍒癏tml:
public byte[] generateHtml(String begCustNo, String endCustNo,
   String reportTitle, String reportFilePath) throws DemoException {
  jdbcCustomerDao = new JdbcCustomerDao();
  Map parameters = new HashMap();
  parameters.put("ReportTitle", reportTitle);
  List list = jdbcCustomerDao.getAllCustomer(begCustNo, endCustNo);
  System.out.println("list size is :" + list.size());
  JRHtmlExporter exporter = new JRHtmlExporter();
  ByteArrayOutputStream oStream = new ByteArrayOutputStream();
  try {
   JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
   JasperPrint jasperPrint = JasperFillManager.fillReport(
     reportFilePath, parameters, ds);
   exporter.setParameter(
     JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,
     Boolean.FALSE);
   exporter
     .setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
   exporter
     .setParameter(JRExporterParameter.CHARACTER_ENCODING, "GBK");
   exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, oStream);
   exporter.exportReport();
   byte[] bytes = oStream.toByteArray();
   return bytes;
  } catch (JRException e) {
   throw new DemoException("Report Export Failed.");
  }
 }
鍒癊xcel:
public byte[] generateExcel(String begCustNo, String endCustNo,
   String reportTitle, String reportFilePath) throws DemoException {
  jdbcCustomerDao = new JdbcCustomerDao();
  Map parameters = new HashMap();
  parameters.put("ReportTitle", reportTitle);
  List list = jdbcCustomerDao.getAllCustomer(begCustNo, endCustNo);
  System.out.println("list size is :" + list.size());
  JRXlsExporter exporter = new JRXlsExporter(); // Excel
  ByteArrayOutputStream oStream = new ByteArrayOutputStream();
  try {
   JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
   JasperPrint jasperPrint = JasperFillManager.fillReport(
     reportFilePath, parameters, ds);
   exporter
     .setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
   exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, oStream);
   exporter.setParameter(
     JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,
     Boolean.TRUE);
   exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET,
     Boolean.FALSE);
   exporter.setParameter(
     JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND,
     Boolean.FALSE);
   exporter.exportReport();
   byte[] bytes = oStream.toByteArray();
   return bytes;

  } catch (JRException e) {
   throw new DemoException("Report Export Failed.");
  }
 }

jsp璋冪敤鏂規(guī)硶錛?br />  <%
    
   
 String filePath=getServletContext().getRealPath("/")+"report.jasper"; 

 CustomerServiceImpl  custs=new CustomerServiceImpl();
    byte[] bytes=null;
  String begNo=request.getParameter("beginCustNo");
  String endNo=request.getParameter("endCustNo");
  String type=request.getParameter("type");

  if(type.equals("Pdf")){ 
      bytes= custs.generatePDF(begNo,endNo,"瀹㈡埛璧勬枡鏄庣粏琛?,filePath);
  }else if(type.equals("Excel")){
   bytes=custs.generateExcel(begNo,endNo,"瀹㈡埛璧勬枡鏄庣粏琛?,filePath);
  }else
     bytes=custs.generateHtml(begNo,endNo,"瀹㈡埛璧勬枡鏄庣粏琛?,filePath);


 if(bytes!=null){
  if(type.equals("Pdf")){
         response.setContentType("application/pdf");
  }else if(type.equals("Excel")){
     response.setContentType("application/vnd.ms-excel");
  }else
   response.setContentType("text/html");
    response.setContentLength(bytes.length);
    ServletOutputStream ouputStream = response.getOutputStream();
    ouputStream.write(bytes,0,bytes.length);
    ouputStream.flush();
    ouputStream.close();
 }else
 {
  out.println("error");
 }
 

 

  %>

======================================
servlet 杈撳嚭

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            
throws ServletException, IOException {
        Connection conn
=null;
        
try{
            Class.forName(
"com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
            conn
=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1481;DatabaseName=pdw","sa","123456");
            ServletContext servletContext
=this.getServletContext();
            Map parameters
=new HashMap();
            parameters.put(
"vname","瑁村痙涓?/span>");
            File reportfile
=new File(servletContext.getRealPath("/classes.jasper"));
            System.out.println(reportfile.getPath());
            
byte[] bytes=JasperRunManager.runReportToPdf(reportfile.getPath(),parameters,conn);
            response.setContentType(
"application/pdf");
            response.setContentLength(bytes.length);
            ServletOutputStream outputStream
=response.getOutputStream();
            outputStream.write(bytes,
0,bytes.length);
            outputStream.flush();
            outputStream.close();
        }
catch(Exception e){
            e.printStackTrace();
        }
    }


]]>
jasperReport鐢ㄦ埛鎵嬪唽http://www.aygfsteel.com/pdw2009/archive/2007/10/31/157161.html鏈夌尗鐩鎬即鐨勬棩瀛?/dc:creator>鏈夌尗鐩鎬即鐨勬棩瀛?/author>Wed, 31 Oct 2007 04:38:00 GMThttp://www.aygfsteel.com/pdw2009/archive/2007/10/31/157161.htmlhttp://www.aygfsteel.com/pdw2009/comments/157161.htmlhttp://www.aygfsteel.com/pdw2009/archive/2007/10/31/157161.html#Feedback0http://www.aygfsteel.com/pdw2009/comments/commentRss/157161.htmlhttp://www.aygfsteel.com/pdw2009/services/trackbacks/157161.html

]]>
主站蜘蛛池模板: 乌苏市| 江陵县| 山丹县| 高淳县| 集安市| 汝阳县| 宜章县| 津市市| 陵川县| 通化县| 福安市| 清镇市| 赣榆县| 芒康县| 峨边| 集安市| 无为县| 杭锦后旗| 开鲁县| 新邵县| 龙南县| 伊川县| 枣强县| 绩溪县| 昌江| 渭源县| 瑞丽市| 汨罗市| 原平市| 延吉市| 敖汉旗| 凤山市| 曲麻莱县| 梧州市| 大邑县| 定襄县| 绍兴市| 攀枝花市| 启东市| 墨玉县| 永寿县|