?
Solved

Flex Printing Problem

Posted on 2008-11-19
3
Medium Priority
?
728 Views
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.

0
Comment
Question by:ASHISHRAIK11
  • 2
2 Comments
 
LVL 7

Accepted Solution

by:
evcr earned 2000 total points
ID: 22996698

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

Expert Comment

by:evcr
ID: 23059252
did that work?
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

850 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