flex ǰ̨µ¼³öExcel
/**=========main.mxml=========*/
/* µ¼³öexcel */
private function exp():void{
if(dgEnterprise.dataProvider==null){
Alert.show("Êý¾ÝΪ¿Õ£¬ÎÞ·¨µ¼³öexcel","ÓÑÇéÌáʾ");
}else{
ExportExccel.loadDGInExcel(dgEnterprise,"/ssfxSystem/excelexport.jsp?tableName=ÆóÒµÐÅÏ¢");
}
}
/**=========excelexport.jsp=========*/
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%><%@ page language="java"%>
<%@ page contentType="application/msexcel;charset=UTF-8"
pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
String name="";
if (request.getParameter("tableName") != null) {
name = request.getParameter("tableName");
} else {
name = "report";
}
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
Date d1 = new Date();
String date = formatter.format(d1);
response.setHeader("Content-disposition", "attachment; filename="
+" "+name+ "-" + date + ".xls");
String str = request.getParameter("htmltable");
out.print(str);
%>
/**=========ExportExcel.as=========*/
package utils
{
import flash.errors.*;
import flash.events.*;
import flash.external.*;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLVariables;
import flash.net.navigateToURL;
import mx.controls.DataGrid;
public class ExportExccel
{
public function ExportExccel()
{
}
private static function convertDGToHTMLTable(dg:DataGrid):String {
//Set default values
var font:String = dg.getStyle('fontFamily');
var size:String = dg.getStyle('fontSize');
var str:String = '';
var colors:String = '';
var style:String = 'style="font-family:'+font+';font-size:'+size+'pt;"';
var hcolor:Array;
//Retrieve the headercolor
if(dg.getStyle("headerColor") != undefined) {
hcolor = [dg.getStyle("headerColor")];
} else {
hcolor = dg.getStyle("headerColors");
}
//Set the htmlta
Ïà¹ØÎĵµ£º
Ç°Ò»ÕóÔÚÂÛ̳ÉÏ¿´µ½Ò»¸öÐֵܣ¬ÏëÔÚFlex ChartÖÐΪͼÀýÉèÖÃ3DЧ¹û,½ü¼¸Ìì²éÕÒÁËЩ×ÊÁÏ£¬¶¯ÊÖ×öÁ˸öDEMO¹©´ó¼Ò²Î¿¼!
DEMOÑÝʾµØÖ·http://xingjunli.webs.com/flash/flexChartDemo.swf,ÏÈÀ´¸öͼƬ¿´¿´×îÖÕЧ¹û:
Ïà¹Ø֪ʶµã
......
һλFlexºÍJavaFXµÄRIA¿ª·¢ÕßÔÚ±¾ÆªÎÄÕÂÖжÔFlex£¬JavaFXºÍSilverlightµÄ¹¦ÄܺÍÓÅȱµã¸÷×Ô×ö³öÁËÆÀÂÛ¡£JavaFX1.1ÓÚ½ñÄê2Ô·¢²¼£¬2.0°æµÄ·¢²¼Ò²ÕýÔڼƻ®ÖС£
Flex, JavaFX, Silverlight…
̹°×À´Ëµ£¬ÔÚ¿ª·¢Õâ¸öÓ¦ÓÃÆڼ䣬ÎÒÔÚÄÚÐÄÒ»Ö±ÔڱȽÏÓÃJavaFX×öÓëÓÃAdobe Flex×öͬÑùµÄÊÂÇé¡£
¼òµ¥ËµÀ´£¬ÔÚ½ñÌ죬 Flex±ÈJav ......
¹ØÓÚFlex»òFlashµÄ¿çÓò·ÃÎʵĽâ¾ö·½°¸£¬ÊÂÇéµÄÆðÒòÊÇ£¬ÓÉÎÒ¹«¿ªµÄÒ»¸öwebservice£¨²»Çå³þÕâ¸öwebservice¸ÉʲôµÄÇë¿´ÕâÀ¿ªÊ¼µÄ£¬kenshinµÄÅóÓÑsensunÔÚÕâ¸ö¹«¿ªµÄwebserviceµÄ»ù´¡ÉÏÖÆ×÷ÁËÒ»¸öweather²éѯµÄ£¬ÔÚ±¾»ú²âÊÔok£¬Ò»Äõ½ÍøÉÏ£¬¾Í»á³öÏÖerror£¨ÊÇ¿çÓò·ÃÎʵĴíÎ󣩣¬ºóÀ´£¬kenshinÖÕÓÚÕÒµ½ÁËÕâ¸öÎÊÌâµÄ½â¾ö·½° ......
Summary:
ÔÚDataGridÖÐÏÔʾ²ã¼¶½á¹¹£¬googleÁËһϣ¬ÕÒµ½flexlibÖеÄTreeGrid¡£°ÑÔ´Âë¼ÓÔص½ÏîÄ¿ÖУ¬°´ÕÕÎĵµÈ¥ÊµÏÖÆ书ÄÜ¡£×îºó·¢ÏÖÓкöàbug£¬±ÈÈ綨λ²»×¼£¬ÎÞ·¨Í϶¯µÈÎÊÌ⡣ͨ¹ýÔĶÁºÍÐÞ¸ÄTreeGridÀ࣬ÕâЩbug¶¼½â¾öÁË¡£½Ó×ÅÎÞÒâÖз¢ÏÖ£¬ÅÅÐòÓÐÎÊÌâ¡£µã»÷ÁÐÍ·ÅÅÐò£¬·¢Ïֲ㼶½á¹¹±ä»ìÂÒÁË£¬Õâ¸öÎÊÌâ±È½ÏÑÏÖØ¡£ÒòΪcreat ......
±¾ÆªÎÄÕÂÊÇ¡¶Flash Builder 4 beta (Gumbo) UI¡¢¹¦ÄܵÄÐÂÌåÑé¡·µÚÈýƪÎÄÕ£¬×ÅÖؽéÉܵÄFlex SDK 4(Gumbo)ÐÂÔö¼ÓµÄÃüÃû¿Õ¼ä£¨NameSpace£©¡£
ÖÚËùÖÜÖª£¬Flex SDK 4(Gumbo)Ôö¼ÓÁËһЩÃüÃû¿Õ¼ä£¬Çë¿´ÈçÏ£º
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/halo"
xmlns:s="library://ns.a ......