Flex Printing Problem

Posted on 2008-11-19
Last Modified: 2013-11-12
Our application is using some components which are placed in the main mxml file. We form a LineChart which internally has many different objects and components for its composition. We display this chart on left hand side of the window.


Also we have some data which we add in a datagrid in the same main mxml and display this data grid on the right hand side of window.


The requirement is to print these things in following order.


First Page

Header <Chart Heading>
Line Chart

Second Page

Header <Static Header>
Data Grid

In Flex, We have two apis which I think could be used to achieve this.

FlexPrintJob   and    PrintJob


To use FlexPrintJob, there is a method to addObject() for printing, but every new object added goes on a new page, so instead of two pages, four pages are printed.


To use PrintJob,  there is a method to addChild() for printing , but when the line chart and datagrid are added as child they are removed from the UI because the object  itself is added when we call addChild() and not the reference. For bypassing this, if we take a snapshot of this chart and datagrid and convert it to an image for printing, it is not getting printed because the image object has the data of the image which is not actually displayed on the UI. So this approach also doesnt work.


We also tried a TitleWindow approach by using its visible and alpha properties, which is not helping.


If you have come across such situation and could kindly hint us on the same, It would be really helpful as this is very critical issue for the release to happen.

Question by:ASHISHRAIK11
    LVL 7

    Accepted Solution


    Using the first option (FlexPrintJob). What happens if you put the objects inside a canvas then AddObject the canvas to the printJob?
    LVL 7

    Expert Comment

    did that work?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
    In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
    The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
    The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now