Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7949659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:03:13+00:00 2026-06-04T02:03:13+00:00

I am trying to print a table in Flex 3.2 using FlexPrintJob. I need

  • 0

I am trying to print a table in Flex 3.2 using FlexPrintJob. I need normal printing behavior – one page if all rows fit on a single page, full page(s) of rows followed by a partially filled page if there is enough data to fill more than one page. Somehow, I get a page per row, where each page has a table header, followed by one row of data, followed by empty space.

Table with 15 rows results in a 15 page document. I get the same behavior in Firefox and IE8.

What can be causing this behavior?
Thanks for your help!

Here’s the code:

        // The function to print the output.
    public function onPrint():void {
        var printJob:FlexPrintJob = new FlexPrintJob();
        printJob.start();

        var thePrintView:FormPrintView = new FormPrintView();
        addChild(thePrintView);
        thePrintView.initPrintDataGrid(openSequences);
        // thePrintView.printOpenTimeGrid.dataProvider = printOpenTime.dataProvider;
        thePrintView.validateNow();

        thePrintView.width=printJob.pageWidth;
        thePrintView.height=printJob.pageHeight;

        printJob.addObject(thePrintView, FlexPrintJobScaleType.MATCH_WIDTH);

        while (thePrintView.printOpenTimeGrid.validNextPage) {
            //Put the next page of data in the view.
            thePrintView.printOpenTimeGrid.nextPage();
            //Queue the additional page.
            printJob.addObject(thePrintView, FlexPrintJobScaleType.MATCH_WIDTH);
        }

        printJob.send();
        removeChild(thePrintView);
        this.onClose();
    }

PrintDataGrid is located directly in the TitleWindow object:

   <!-- The data grid. The sizeToPage property is true by default, so the last
    page has only as many grid rows as are needed for the data. -->
<mx:PrintDataGrid id="printOpenTimeGrid" dataProvider="{openSequences}" sizeToPage="true" width="100%" height="100%">
    <mx:columns>
        <mx:DataGridColumn dataField="startDate" headerText="Seq Date" width="70">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox>
                        <mx:DateFormatter id="startDateFormatter" formatString="M/D/YYY"/>
                        <mx:Label fontWeight="bold" text="{startDateFormatter.format(data.startDate)}"/>
                    </mx:VBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
        <mx:DataGridColumn dataField="equipCode" headerText="EQP" width="40" />
        <mx:DataGridColumn dataField="base" headerText="BSE" width="40" />
        <mx:DataGridColumn dataField="sequenceNumber" headerText="SEQNO" width="45" />
        <mx:DataGridColumn dataField="seat" headerText="ST" width="40" />
        <mx:DataGridColumn headerText="DPRT" width="40">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox>
                        <mx:DateFormatter id="departTimeFormatter" formatString="JJNN"/>
                        <mx:Label fontWeight="bold" text="{departTimeFormatter.format(data.startDate)}"/>
                    </mx:VBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
        <mx:DataGridColumn dataField="terminationDate" headerText="ARVL/DT" width="60" >
            <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox>
                        <mx:DateFormatter id="arvDateFormatter" formatString="JJNN/DD"/>
                        <mx:Label fontWeight="bold" text="{arvDateFormatter.format(data.startDate)}"/>
                    </mx:VBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
        <mx:DataGridColumn dataField="tripValue" headerText="TTL" width="50" />
        <mx:DataGridColumn dataField="blockType" headerText="Block Type" width="170" />
    </mx:columns>
</mx:PrintDataGrid>

Printout looks like this
One Row Per Page

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:03:14+00:00Added an answer on June 4, 2026 at 2:03 am

    The problem is solved by adding a ‘height’ parameter to the TitledWindow object (the wrapper of the PrintDataGrid). When height is set to 800, content prints onto a full page, and does’t show a scroll bar.

    <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" title="Open Time" height="800">
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.core.*;
    
            [Bindable]
            private var openSequences:ArrayCollection;
    
            public function initPrintDataGrid(sequences:ArrayCollection):void {
                openSequences = sequences;
            }
        ]]>
    </mx:Script>
    
    <!-- The data grid. The sizeToPage property is true by default, so the last
        page has only as many grid rows as are needed for the data. -->
    <mx:PrintDataGrid id="printOpenTimeGrid" dataProvider="{openSequences}" sizeToPage="true" 
        width="100%" height="100%">
        <mx:columns>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to print a table inside an e-mail using plain text. I
I am trying to print a table using javascript the table html is like
I am trying to print Arabic text in cell inside table (in pdf) using
I have a table with ~100,000 rows. I am trying to print to screen
I'm trying to query the country table with the below query to print all
Im trying print Excel file data on a page. To do it i used
I am trying to print the page by java script. The code is like
I'm trying to print all the keys, values from a json response without knowing
i'm trying to print ascii or extended ascii character. using this code : print
I'm trying to print a table with a lot of columns, so that the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.