PDA

View Full Version : Print Functionality -Tree control.


FlexDeveloper
07-03-2008, 07:17 PM
Hi,

I am trying to print a tree using FlexPrintJob,Code i am using is

var printJob:FlexPrintJob = new FlexPrintJob();
if (printJob.start()) {
printJob.addObject(treeId,FlexPrintJobScaleType.FI LL_PAGE);

}
// Send the job to the printer.
printJob.send();

treeId is the id of mx:tree control.
The issue is this code does not print the complete tree ,It only displays the visible portion on the screen.To print next i have to scroll tree and then fire print again,Is there any way in which i can print the full tree.

Any help would be great.
Thanks.

mattb
07-08-2008, 03:53 AM
Flex prints the visible area as you say, so you need to think of a way of displaying the entire tree control - eg making creating a large canvas and putting the tree at 100% of that canvas.

FlexDeveloper
07-08-2008, 10:12 PM
ya i tried incresing the tree height by setting after print job start
tree.height = tree.measureHeightOfItems()+100;
once print is done i set the height to:
tree.percentHeight=100;

it is working fine.Thanks for the reply.