to_ruport_table

3 views
Skip to first unread message

webs...@gmail.com

unread,
Jun 12, 2007, 11:14:30 PM6/12/07
to Ruby Reports
Hi,

is there a suggested method naming convention for converting an object
to a ruport table like to_ruport_table

Also, the default pdf output is nice with the rotating colors. Can
this effect be added to the default html output? Where can I find the
documentation/samples/source for to_html options?

Thanks,
Greg

Michael Milner

unread,
Jun 13, 2007, 12:07:40 AM6/13/07
to ruby-r...@googlegroups.com

Hi Greg,

We've used report_table, so that's as close to a convention as we have.

It'd be a little complicated to add the alternating rows to html output.  I don't think we want to add it as a default because not everyone would want it (but other people can let me know if I'm wrong about that).  So, basically, you'd need to define a custom formatter to add css tags to the rows.  If it's something you want to work on, I'd be glad to help you with it.

You can find some examples, links to API documentation, etc, on our home page:  http://rubyreports.org and on the wiki http://code.rubyreports.org.

Mike

cas...@gmail.com

unread,
Jun 25, 2007, 10:54:07 PM6/25/07
to Ruby Reports

On Jun 12, 9:07 pm, "Michael Milner" <mikem...@gmail.com> wrote:

> It'd be a little complicated to add the alternating rows to html output. I
> don't think we want to add it as a default because not everyone would want
> it (but other people can let me know if I'm wrong about that). So,
> basically, you'd need to define a custom formatter to add css tags to the
> rows. If it's something you want to work on, I'd be glad to help you with
> it.
>

I ended up needing this, as well adding classes to the table, and
making thead and tbody tags. If you pass an array as your row_class
than it will alternate amongst them, so doing a :row_class => ['odd',
'even'] with some CSS would give you zebra striping. I think all 3 of
those changes are generally useful. I would appreciate any comments.

http://pastie.caboo.se/73475

Gregory Brown

unread,
Jun 26, 2007, 10:15:16 AM6/26/07
to ruby-r...@googlegroups.com
On 6/25/07, cas...@gmail.com <cas...@gmail.com> wrote:

> I ended up needing this, as well adding classes to the table, and
> making thead and tbody tags. If you pass an array as your row_class
> than it will alternate amongst them, so doing a :row_class => ['odd',
> 'even'] with some CSS would give you zebra striping. I think all 3 of
> those changes are generally useful. I would appreciate any comments.
>
> http://pastie.caboo.se/73475

I think our HTML formatter can use some extra helpers like this, and
since you do it via classes, it seems pretty general.

Can you prepare a patch against trunk with tests?

Reply all
Reply to author
Forward
0 new messages