PDF::Writer and table columns



I've just started using the PDF::Writer and am having some trouble with
table columns. When the PDF renders the columns of the table are not
ordered by the column_order. With my test data I have three tables with
each table having a different column order and the last one being correct.
The order of te first two columns on every table is consistent.

Here's a sample of the code:

table.column_order = %w(t field old new changed)

table.columns["t"] = PDF::SimpleTable::Column.new("t") {|col|
heading = PDF::SimpleTable::Column::Heading.new
heading.title = "T"
col.heading = heading
}
#repeat this for each of the columns

#to load the data
data = []
rows.each{ |row|
data << {"t" => row.change_type,
"field" => row.field_name,
"old" => row.old_value,
"new" => row.new_value,
"changed" => row.changed_at}
}

I hope it's a case of "been staring at this for too long".

thanks,
andy
--
Andrew Stone


Relevant Pages

  • Re: PDF::Writer and table columns
    ... When the PDF renders the columns of the table are not ... With my test data I have three tables with ... >> each table having a different column order and the last one being correct. ... patches. ...
    (comp.lang.ruby)
  • Re: PDF::Writer and table columns
    ... When the PDF renders the columns of the table are not ... With my test data I have three tables with ... > each table having a different column order and the last one being correct. ... Prev by Date: ...
    (comp.lang.ruby)
  • Re: more than one set of records separated by blank lines
    ... trigger on the last entry instead. ... Please try posting a complete program if you are having more trouble. ... the special file handle to include test data in a test program. ...
    (comp.lang.perl.misc)
  • [OT]: some "newbie" questions
    ... > I am having some trouble with the earlier excercises and some ... create a text file and put test data in it. ... it also has the benefit of letting the system take care of EOF ...
    (comp.lang.c)