Flex Printing Problem

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.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
did that work?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.