0
我需要在A4大小的頁面中打印以下數據網格。它不適合與頁面大小和dataprovider不工作的printdatagrid.Pleasecorrect我。Flex數據網格打印問題,頁面大小爲
電流輸出是:
我的數據網格中:
<mx:DataGrid id="dashboardList" width="100%" height="95%"
alternatingItemColors="[0x373737, 0x373737]"
borderColor="#FFFFFF" borderStyle="inset"
chromeColor="#295A7D" contentBackgroundColor="#373737"
dataProvider="{allTrancList}" fontWeight="normal"
horizontalGridLineColor="#858585" click="productDatagrid_clickHandler(event)"
horizontalGridLines="true" variableRowHeight="true"
wordWrap="true">
<mx:columns>
<mx:DataGridColumn width="60" headerText="S.No"
labelFunction="serialNoLabelFunc2"/>
<mx:DataGridColumn width="60" dataField="trancCode"
headerText="Order ID"/>
<mx:DataGridColumn dataField="date" headerText=" Date"
labelFunction="getDateLabel"/>
<mx:DataGridColumn dataField="clientName"
headerText="Client name"/>
<mx:DataGridColumn width="90" dataField="clientCode"
headerText="Client code"/>
<mx:DataGridColumn dataField="itemType"
headerText="Work/Product"/>
<mx:DataGridColumn width="60" dataField="itemNumbers"
headerText="Count"/>
<mx:DataGridColumn dataField="cost" headerText="Cost"/>
<mx:DataGridColumn dataField="discountAmount"
headerText="Discount"/>
<mx:DataGridColumn dataField="tax" headerText="Tax"/>
<mx:DataGridColumn dataField="total" headerText="Total"/>
<mx:DataGridColumn dataField="paymondmode"
headerText="Payment mode"/>
</mx:columns>
</mx:DataGrid>
我printData格:
<mx:PrintDataGrid id="myDataGrid" width="99%" height="100%">
<mx:columns>
<mx:DataGridColumn width="60" dataField="trancCode"
headerText="Order ID"/>
<mx:DataGridColumn dataField="clientName"
headerText="Client"/>
<mx:DataGridColumn width="90" dataField="clientCode"
headerText="Client code"/>
<mx:DataGridColumn dataField="itemType"
headerText="Type"/>
<mx:DataGridColumn width="60" dataField="itemNumbers"
headerText="Count"/>
<mx:DataGridColumn dataField="cost" headerText="Cost"/>
<mx:DataGridColumn dataField="discountAmount"
headerText="Discount"/>
<mx:DataGridColumn dataField="tax" headerText="Tax"/>
<mx:DataGridColumn dataField="total" headerText="Total"/>
<mx:DataGridColumn dataField="paymondmode"
headerText="Payment mode"/>
</mx:columns>
</mx:PrintDataGrid>
我的打印代碼:
var thePrintView:FormPrintView = new FormPrintView();
addElement(thePrintView);
// Set the print view properties.
thePrintView.width=printJob.pageWidth;
thePrintView.height=printJob.pageHeight;
thePrintView.prodTotal = prodTotal;
// Set the data provider of the FormPrintView
// component's DataGrid to be the data provider of
// the displayed DataGrid.
// thePrintView.myDataGrid=PrintDataGrid(dashboardList);
thePrintView.myDataGrid.dataProvider =allTrancList;
有你嘗試在PrintDataGrid上設置variableRowHeight =「true」wordWrap =「true」,並將其他屬性設置爲與dashboardList datagrid相同。像: - –
2013-02-12 07:31:38