What steps will reproduce the problem?
1. Initialize a ArrayCollection object with some hardcoded data.
2. Create a Grid object with this arraycollection and add it to PDF object.
3. Generate pdf from it.
What is the expected output? What do you see instead?
Expected outout is to get PDF with data we added in arraycollection. But
it contains an additional column for mx_internal_uid that flex sdk
generates for each object. It is because, we did not explicitly set the
columns property of the Grid. in that case it iterates thru the properties
of firstItem object in collection and creates column for each object
property including mx_internal_uid.
What version of the product are you using? On what operating system?
Version - AlivePDF 0.1.4.8
OS - XP
Flex SDK 3.1.2
Please provide any additional information below.
If you analyze the addGrid function in PDF.as it has below code -
if ( columns == null )
{
var firstItem:* = buffer[0];
var fields:Array = new Array();
var column:GridColumn;
for ( var p:String in firstItem )
fields.push ( p );
fields.sort();
columns = new Array();
var fieldsLng:int = fields.length;
for (i = 0; i< fieldsLng; i++)
columns.push ( new GridColumn (
fields[i], fields[i], 30 ) );
}
You can see in for loop, it is adding all the fields. One of the solutions
could be to check the value of 'p' and if it is flex's internal properties
then those could be avoided from adding in grid.
eg. if(p != 'mx_internal_uid') fields.push(p)
Please have a look at this. Adding columns each time should not be a bound
task. In my case i want all data to be displayed without modifying columns
indices or filters. so i dont want to create GridColumns for my all
columns in collection.
PFA my code files.
Original issue reported on code.google.com by pushp.ja...@gmail.com on 16 Mar 2009 at 9:03
Original issue reported on code.google.com by
pushp.ja...@gmail.com
on 16 Mar 2009 at 9:03Attachments: