5/16/2011 3:25:22 AM
Title:
how can we print s list data in flex
hew frnds,
plz see this sample example
I want to print all data in flex 4
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="950" height="600" >
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.printing.FlexPrintJob;
import mx.printing.FlexPrintJobScaleType;
protected function button1_clickHandler(event:MouseEvent):void
{
lstStudentData.dataProvider = arrCol_Div_Chars;
}
protected function btnPrint_clickHandler():void
{
// WANT TO WRITE PRINT CODE HERE
}
]]>
</fx:Script>
<fx:Declarations>
<s:ArrayCollection id="arrCol_Div_Chars">
<fx:Object label='11' />
<fx:Object label='22' />
<fx:Object label='33' />
<fx:Object label='44' />
<fx:Object label='55' />
<fx:Object label='66' />
<fx:Object label='77' />
<fx:Object label='88' />
<fx:Object label='99' />
<fx:Object label='100' />
<fx:Object label='11' />
<fx:Object label='22' />
<fx:Object label='33' />
<fx:Object label='44' />
<fx:Object label='55' />
<fx:Object label='66' />
<fx:Object label='77' />
<fx:Object label='88' />
<fx:Object label='99' />
<fx:Object label='100' />
</s:ArrayCollection>
</fx:Declarations>
<s:VGroup>
<s:Button label="Show " click="button1_clickHandler(event)" />
<s:Button label="Print" click="btnPrint_clickHandler()" />
</s:VGroup>
<s:List width="900" height="500" id="lstStudentData" itemRenderer="compononts.CustomListItemRenderer"
useVirtualLayout="true" >
<s:layout >
<s:TileLayout requestedColumnCount="2" horizontalAlign="center" verticalAlign="middle"
/>
</s:layout>
</s:List>
</s:WindowedApplication>
5/16/2011 6:36:37 AM
you can look at this similar question to print data in flex
http://askmeflash.com/qdetail/881/how-to-print-in-air-flex
5/16/2011 10:23:14 PM
tht example is not working in flex 4