How to force printdatagrid to auto fit with its content ?

Bcos every time I try to put more than 5 lines in one grid cell

And maybe 2 or 3 lines on another cells 

The grid output is really disappointed.. the next row will automatically
jump out 

To another page even if it could still be fit in one page..

I'm not sure.. but maybe it has something to do with validateNow();

What do u think ?

Does anyone have the better idea to print datagrid..?

Thanx in advance. :D

 

import mx.core.*

            // Declare and initialize the variables used in the component.

            // The application sets the actual prodTotal value.

            [Bindable]

            public var pageNumber:Number = 1;

 

 

            // Control the page contents by selectively hiding the header
and

            // footer based on the page type.

            public function showPage(pageType:String):void {

                if(pageType == "first" || pageType == "middle") {

                    // Hide the footer.

                    footer.includeInLayout=false;

                    footer.visible = false;

                    

                    footer2.includeInLayout=false;

                    footer2.visible = false;

                    

                    footer345.includeInLayout=false;

                    footer345.visible = false;

                    footer6.visible = false;

                }

                if(pageType == "middle" || pageType == "last") {

                    // The header won't be used again; hide it.

                    header.includeInLayout=false;

                    header.visible = false;

                    

                    header2.includeInLayout=false;

                    header2.visible = false;

                    

                    header3.includeInLayout=false;

                    header3.visible = false;

                }

                if(pageType == "last") {

                    // Show the footer.

                    footer.includeInLayout=true;

                    footer.visible = true;

                    

                    footer2.includeInLayout=true;

                    footer2.visible = true;

                    

                    footer345.includeInLayout=true;

                    footer345.visible = true;

                    footer6.visible = true;

                }

                //Update the DataGrid layout to reflect the results.

                validateNow();

                

            }        

 

 

<mx:PrintDataGrid  id="myDataGrid" height="100%" width="100%" 

       fontSize="10" fontFamily="Arial" wordWrap="true" textAlign="left">

    <!-- Specify the columns to ensure that their order is correct. -->

        <mx:columns>

            <mx:DataGridColumn headerText="CRITERIA " dataField="category"/>

                                    <mx:DataGridColumn fontSize="9"
headerText="Max.Score" dataField="maxscore" width="76"/>

                                    <mx:DataGridColumn fontSize="9"
headerText="RATING" dataField="urscore" width="75"/>

        </mx:columns>

    </mx:PrintDataGrid>

 

 

 

 

 

 

 

 

 

 

Reply via email to