You mean it shows the default flex theme but not the components? You may
want to specify the layout="vertical" or layout="horizontal" in the
<mx:Application> element.

Thanks,
Gaurav

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of jesse_bigfix
Sent: Monday, January 28, 2008 9:36 PM
To: [email protected]
Subject: [flexcoders] Why does this print a blank page?

The code below results in a blank page, I don't understand why...

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
   <mx:Script>
        <![CDATA[
                import mx.controls.Label;
                import mx.containers.VBox;
                import mx.printing.FlexPrintJob;
                import mx.collections.ArrayCollection;
                [Bindable]
                private var medalsAC:ArrayCollection = new
ArrayCollection( [
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 }
]);
                
            public function doPrint():void
            {
                var pj:FlexPrintJob = new FlexPrintJob();
                var holder:VBox = new VBox();
                var header:Label = new Label();
                header.text = "Gold Medals";
                holder.height = pj.pageHeight;
                holder.width = pj.pageWidth;
                holder.addChild(header);
                holder.addChild(chart);
                Application.application.addChild(holder);
                validateNow();
                pj.start();
                pj.addObject(holder);
                pj.send();              
            }
        ]]>
   </mx:Script>
        <mx:PieChart id="chart" dataProvider="{medalsAC}" >
            <mx:series>
                <mx:PieSeries field="Gold" />   
            </mx:series>
     </mx:PieChart>
     <mx:Button click="doPrint()" label="Print" />
 </mx:Application>



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



Reply via email to