Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF not displaying 4th column data in datagrid. #355

Open
GoogleCodeExporter opened this issue Oct 22, 2015 · 0 comments
Open

PDF not displaying 4th column data in datagrid. #355

GoogleCodeExporter opened this issue Oct 22, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

When saving a PDF, all of the elements are visible (header imaage, image, and 
datagrid) except it seems to always omit the data from the 4th column.  

private function printPDF(event:MouseEvent):void
{
   var PDFcolumns:Array = getPDFColumns(_dataGrid);
   var resultsArray:Array = _dataGrid.dataProvider.toArray();
   var pdf:PDF  = new PDF(Orientation.PORTRAIT,Unit.MM,Size.LETTER);

   pdf.addPage();
   pdf.setFont(new CoreFont(),10);
   pdf.textStyle(new RGBColor(0x000000));

   var grid:Grid = new Grid(_dataGrid.dataProvider.toArray(),0,_dataGrid.height,new RGBColor(0xDDDDDD),
                    new RGBColor(0xF9F9F9), new RGBColor(0xFFFFFF), true, new
                    RGBColor(0x000000), 1);

                grid.columns = PDFcolumns;

     pdf.setFont(new CoreFont(),10);
     pdf.textStyle(new RGBColor(0x000000));
     pdf.addGrid(grid,0,160);          

    var ba:ByteArray = pdf.save(Method.LOCAL);
    var fr:FileReference = new FileReference();

    fr.save(ba, "savedconfig.pdf");
}

private function getPDFColumns(datagrid:DataGrid):Array
{

   var PDFcolumns:Array = new Array;         
   var dataGridColumn:DataGridColumn;

   for( var i:Number = 0; i < datagrid.columns.length; i++ ) 
    {
       dataGridColumn = datagrid.columns[i];

       if (dataGridColumn.visible)
       {
          var gridColumn:GridColumn = new  GridColumn(dataGridColumn.headerText,
                            dataGridColumn.dataField, 
                            dataGridColumn.width * 0.27);

          PDFcolumns.push(gridColumn);
         }
       }
    return PDFcolumns;
}

What steps will reproduce the problem?
1. Apply the code above.
2. After saving the PDF, the PDF will show the missing data.

What is the expected output? What do you see instead?

The datagrid to display the data in all of the columns


What version of the product are you using? On what operating system?
1.5RC on Windows 7


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 22 Mar 2012 at 9:39

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants