sivarajankumar / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

GridColumn constructor truncates width #111

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a PDF using Unit.INCHES
2. Using the GridColumn constructor, create columns with a width of less than 
one inch.
3. The column will not show on the output.

For example:
    // Create a pdf and a grid.
    var myPDF:PDF = new PDF(Orientation.PORTRAIT, Unit.INCHES, Size.LETTER);
    myPDF.setFont(FontFamily.ARIAL);
    var data:Array = [{field1:'a', field2:'A'}, {field1:'b', field2:'B'}];
    var grid:Grid = new Grid(data, 2.0, 0.75, new RGBColor(0xDDDDDD),  new RGBColor(0xFFFFFF),
                new RGBColor(0x000000), true, new RGBColor(0));

    myPDF.addPage();
    // When the GridColumn() constructor is used, column 'One' fails to show up because width is 
treated as an int.
    grid.columns = [new GridColumn('One', 'field1', 0.75), new GridColumn('Two', 'field2', 1.25)];
    myPDF.addGrid(grid, 0.75, 0.75);

    myPDF.addPage();
    // When the GridColumn() constuctor is not used, column 'One' appears as expected.
    grid.columns = [{headerText:'One', dataField:'field1', width:0.75}, {headerText:'Two', 
dataField:'field2', width:1.25}];
    myPDF.addGrid(grid, 0.75, 0.75);

    myPDF.save(Method.REMOTE, url, Download.INLINE);

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

Expect both columns to show up on both sets of output.  Column shows up in the 
second grid, not the first.  
(Note:  pages are off because because a height of '5' is used in PDF.addRow().

What version of the product are you using? On what operating system?

0.148 on Vista

Please provide any additional information below.

Original issue reported on code.google.com by lam...@gmail.com on 16 Mar 2009 at 8:04