I'm surprised you aren't getting an error or warning in the console.  I think 
the use of callLater doesn't work during a printjob and the job might 
eventually timeout (see Flash Player's printing classes for timeout limits).  
Usually, all external data needs to be pre-loaded and the whole print page 
needs to have some validateNow call and send() right in the loop.  You can't 
put things off.  It is actually a bug in FP that you can't defer work.  I'm 
hoping they'll fix it someday, but it didn't make FP10.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of donvoltz
Sent: Saturday, August 30, 2008 8:36 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Printing Problems


Would anyone be able to tell me why the following code creates a blank
page. I am using Flex 3 on Mac OS 10.5

I am able to add the custom printing compoent to the application, the
print dialog opens and it looks to be processing the print, however, I
am left with 2 blank pages when it is done. In addition, it crashes
Firefox when the print job is complete. I have added some of the ideas
presented in this group, however, can not seem to find any additional
information on the web about this problem. Has anyone overcome the issue.

The function I am using to print is as follows

private function printDailyManpowerList(event:MouseEvent):void {
var printJob:FlexPrintJob = new FlexPrintJob(); //create flex
print job
if (printJob.start() != true){
return;
}
var dailyPrint:DailyManpowerListPrintView = new
DailyManpowerListPrintView(); //create new print component
this.parentApplication.addChild(dailyPrint);
printJob.addObject(dailyPrint);
callLater(printJob.send); //start print
this.parentApplication.removeChild(dailyPrint);//remove component from
container
}

The code for the DailyManpowerListPrintView is

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml";
xmlns:views="com.dynamicmedicalventures.De2ORApplication.views.*"
backgroundColor="#FFFFFF" width="500" height="900">
<mx:Script>
<![CDATA[
import
com.dynamicmedicalventures.De2ORApplication.vo.CoordinatorMessageVO;
import com.dynamicmedicalventures.De2ORApplication.model.AppModelLocator;
import
com.dynamicmedicalventures.De2ORApplication.factories.UtilityFunctions;
import mx.events.CloseEvent;
import mx.managers.PopUpManager;

[Bindable]
private var modelLocator:AppModelLocator = AppModelLocator.getInstance();
[Bindable]
public var messageDetails:CoordinatorMessageVO;
]]>
</mx:Script>

<mx:Label id="printTitle" text="Daily Manpower List for
{UtilityFunctions.formatDateDisplay(modelLocator.selectedDate)}"/>
<views:UserListPrint id="dailyUsers"
initialUserList="{modelLocator.dailyUserList}" width="100%"
height="50%" />
</mx:VBox>

Thanks for any help

Don

Reply via email to