[flexcoders] PrintJob() with DataGrid Timing Issue

2005-04-13 Thread convergenceii


Has anyone had any problems with a datagrid not being resized before
being printed?  Basically, within the print function, I find out what
size the page is and resize the datagrid to the available space. 
However, it doesn't get resized before the .addPage() is called, so
the printed page uses the previous size.  Since I can't call
pj.start() ahead of time, I'm not sure what else I can do, unless
there is a way to delay within a function.

Any ideas / suggestions / examples would be GREATLY appreciated. 
Thanks in advance!

Here is my function (page is simply a canvas with a VBox):

function printPage()
{
pj = new PrintJob();

if(pj.start() != true)
{
delete pj;
return;
}

_parent.width = pj.pageWidth;
reportVBox.width = pj.pageWidth;
printDataGrid.width = pj.pageWidth;

_parent.height = pj.pageHeight;
reportVBox.height = pj.pageHeight;
printDataGrid.height = 700;

this.redraw();

pj.addPage(reportVBox);

pj.send();
delete pj;
}






 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: PrintJob() with DataGrid Timing Issue

2005-04-13 Thread convergenceii


I tried that too, but I am unable to seperate the PrintJob() methods
across more than one function (.start, .addPage, .send).  MM warns
against doing much from the time the PrintJob is started to the time
it is sent, but apparently there is more to it than just timing.

--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED]
wrote:
 I tried this myself but failed.
 
 I created the PrintJob
 Determined the page height
 Set the height of the DataGrid
 Then used doLater() to finish adding pages and sending the job.
 (doLater should have let the DG resize)
 
 Seemed reasonable, but it did not work.
 Tracy
 
 -Original Message-
 From: convergenceii [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, April 13, 2005 9:22 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] PrintJob() with DataGrid Timing Issue
 
 
 
 Has anyone had any problems with a datagrid not being resized before
 being printed?  Basically, within the print function, I find out
what
 size the page is and resize the datagrid to the available space. 
 However, it doesn't get resized before the .addPage() is called, so
 the printed page uses the previous size.  Since I can't call
 pj.start() ahead of time, I'm not sure what else I can do, unless
 there is a way to delay within a function.
 
 Any ideas / suggestions / examples would be GREATLY appreciated. 
 Thanks in advance!
 
 Here is my function (page is simply a canvas with a VBox):
 
 function printPage()
 {
   pj = new PrintJob();
   
   if(pj.start() != true)
   {
   delete pj;
   return;
   }
 
   _parent.width = pj.pageWidth;
   reportVBox.width = pj.pageWidth;
   printDataGrid.width = pj.pageWidth;
   
   _parent.height = pj.pageHeight;
   reportVBox.height = pj.pageHeight;
   printDataGrid.height = 700;
   
   this.redraw();
   
   pj.addPage(reportVBox);
   
   pj.send();
   delete pj;
 }
 
 
 
 
 
 
  
 Yahoo! Groups Links





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/