Forum: Ruby PDF::Writer and table columns

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andrew S. (Guest)
on 2006-01-18 01:57
(Received via mailing list)
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
Austin Z. (Guest)
on 2006-01-18 04:40
(Received via mailing list)
On 17/01/06, Andrew S. <removed_email_address@domain.invalid> wrote:
> 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.

I'm not seeing anything wrong with your sample code. Can you provide
me a more complete sample with sample data? If this is business
related, you can email it to me directly. It may also be worth seeing
the output you're getting.

-austin
Austin Z. (Guest)
on 2006-01-18 08:05
(Received via mailing list)
On 17/01/06, Austin Z. <removed_email_address@domain.invalid> wrote:
> On 17/01/06, Andrew S. <removed_email_address@domain.invalid> wrote:
> > 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.

I have reopened bug item #2129, which describes the necessary patch. I
will hopefully be able to provide a patched version soon; I am trying
to track down a number of issues introduced in several adopted
patches.

-austin
Andrew S. (Guest)
on 2006-01-18 16:25
(Received via mailing list)
Thank you Austin.

-andy
This topic is locked and can not be replied to.