MecGrid报表

/**
* 读取数据成功
*/
private function onReportResult(event:ResultEvent):void{
mgrid.clearSubTotalResult();
mgrid.addEventListener(MecGridEvent.DATAPROVIDER_UPDATE_FINISHED, dataProviderUpdatedHandler);
this.dataSource = event.result as ArrayCollection;
if(this.dataSource!=null&&this.dataSource.length>0){
this.vs.selectedIndex = 0;
}else{
this.preload.barLabel = "共查询到0条数据!";
this.preload.fontColor = 0xFF0000;
}
}

private function dataProviderUpdatedHandler(event:MecGridEvent):void
{
mgrid.removeEventListener(MecGridEvent.DATAPROVIDER_UPDATE_FINISHED, dataProviderUpdatedHandler);

mgrid.redraw = false;
mgrid.clearSubTotal();
mgrid.AddSubTotal("总计", [1], MecGridConst.SUBTOTAL_SUM, -1, [2, 3, 4, 5,6,7], MecGridConst.SUBTOTAL_BELOWDATA);
mgrid.AddSubTotal("小计", [1], MecGridConst.SUBTOTAL_SUM, 0, [2, 3, 4, 5,6,7], MecGridConst.SUBTOTAL_BELOWDATA);
mgrid.updateSubTotal();
mgrid.redraw = true;
}

<MecGrid:MecGrid id="mgrid" width="100%" height="100%" dataProvider="{this.dataSource}" ExtendLastColumn="true">
<MecGrid:ResourceXML>
<mx:XML xmlns="">
<List>
<option cols="9" fixedrows="1" fixedcols="0" extendlastcol="T" merge_option="0" merge_option_fixedcolumn="0" merge_option_fixedrow="0" showspreadsheet="F" selectionmode="20" sortoption="0" treeview="T" treeColumn="0" textalignment="6" textalignment_fixed="5"/>
<columns>
<column name="col_1" datafield="xxName" visible="T" editable="F" colindex="0" autowidth="F" width="130" datatype="5" textalign="5" textalign_fixed="10" formatstring="" merge="T" style="fixedcenter" enablefilter="T" header="部门名称"/>
<column name="col_2" datafield="yyName" visible="T" editable="F" colindex="1" autowidth="T" width="250" datatype="5" textalign="4" textalign_fixed="10" merge="F" style="fiexdcolumn" header="事项名称"/>
<column name="col_3" datafield="zzName" visible="T" editable="F" colindex="2" autowidth="F" width="80" datatype="5" textalign="5" textalign_fixed="10" merge="F" style="fiexdcolumn" header="受理"/>
<column name="col_4" datafield="mmName" visible="T" editable="F" colindex="3" autowidth="F" width="80" datatype="5" textalign="5" textalign_fixed="10" merge="F" style="fiexdcolumn" header="办结"/>
<column name="col_5" datafield="xxValue" visible="T" editable="F" colindex="4" autowidth="F" width="80" datatype="5" textalign="5" textalign_fixed="10" merge="F" style="fiexdcolumn" header="作废业务"/>
<column name="col_6" datafield="yyValue" visible="T" editable="F" colindex="5" autowidth="F" width="80" datatype="5" textalign="5" textalign_fixed="10" merge="F" style="fiexdcolumn" header="补交告知"/>
<column name="col_7" datafield="zzValue" visible="T" editable="F" colindex="6" autowidth="F" width="80" datatype="5" textalign="5" textalign_fixed="10" merge="F" style="fiexdcolumn" header="特别程序"/>
<column name="col_7" datafield="mmValue" visible="T" editable="F" colindex="7" autowidth="F" width="80" datatype="5" textalign="5" textalign_fixed="10" merge="F" style="fiexdcolumn" header="正常办理"/>
<column name="col_8" datafield="total" visible="T" editable="F" colindex="8" autowidth="F" width="80" datatype="5" textalign="5" textalign_fixed="10" merge="F" style="fiexdcolumn" header="办结率"/>
</columns>
<styles>
<style name="spreadsheet" backcolor1="16317653" backcolor2="15066597" backalpha1="1" backalpha2="1" bordercolor="6710886" borderthickness="1" bt_top="1" bt_bottom="1" bt_left="1" bt_right="1" fontstyle="0" forecolor="0" fontsize="12"/>
<style name="fiexdcolumn" backcolor1="13434879" backcolor2="16777215" backalpha1="1" backalpha2="1" bordercolor="12566463" borderthickness="1" bt_top="1" bt_bottom="1" bt_left="1" bt_right="1" fontstyle="0" forecolor="3355443" fontsize="12"/>
<style name="fixedcenter" backcolor1="13434879" backcolor2="16777215" backalpha1="1" backalpha2="1" bordercolor="12566463" borderthickness="1" bt_top="1" bt_bottom="1" bt_left="1" bt_right="1" fontstyle="0" forecolor="3355443" fontsize="12"/>
<style name="subtotal" backcolor1="16317653" backcolor2="15066597" backalpha1="1" backalpha2="1" bordercolor="12566463" borderthickness="1" bt_top="1" bt_bottom="1" bt_left="1" bt_right="1" fontstyle="2" forecolor="0" fontsize="12"/>
<style name="fixedrow" backcolor1="15066597" backcolor2="15066597" backalpha1="1" backalpha2="1" bordercolor="6710886" borderthickness="1" bt_top="1" bt_bottom="1" bt_left="1" bt_right="1" fontstyle="0" forecolor="0" fontsize="12"/>
</styles>
</List>
</mx:XML>
</MecGrid:ResourceXML>
</MecGrid:MecGrid>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值