+--------------------------------------------------+ | Name | Title | Spouse | Children | +--------------------------------------------------+ | John | Accountant | Suzy | John Jr. | | George | Watchman | Joan | GeorgetteGeorgina | +--------------------------------------------------+
But what I'd like is:
+--------------------------------------------------+ | Name | Title | Spouse | Children | +--------------------------------------------------+ | John | Accountant | Suzy | John Jr. | | George | Watchman | Joan | Georgette | | | Georgina | +--------------------------------------------------+
Or something similar. Any way to do this? I've started looking at customizing the Text renderer, but I am wondering if perhaps there is an easier way that I've just overlooked. I've not used Ruports until a few days ago. What a great bit of work here, I got rid of all my ugly reporting hacks!
> +--------------------------------------------------+ > | Name | Title | Spouse | Children | > +--------------------------------------------------+ > | John | Accountant | Suzy | John Jr. | > | George | Watchman | Joan | GeorgetteGeorgina | > +--------------------------------------------------+
> But what I'd like is:
> +--------------------------------------------------+ > | Name | Title | Spouse | Children | > +--------------------------------------------------+ > | John | Accountant | Suzy | John Jr. | > | George | Watchman | Joan | Georgette | > | | Georgina | > +--------------------------------------------------+
> Or something similar. Any way to do this? I've started looking at > customizing the Text renderer, but I am wondering if perhaps there is > an easier way that I've just overlooked.
I'm afraid as far as I can tell the text formatter code will only output one row per row in the data table. You could probably iterate over each row in the data table and create a new row with blank values whenever you encounter an array value, but that's nasty and still wouldn't be the exact output you're after. I think joining the array values with a newline would break the table.
So yes I think you're right that the best way would be to override the row builder in the text formatter!
Yes I tried appending a "\n" and it does indeed break the table. OK, I will look at the row builder...this is probably going to be a fair amount of work, judging from a cursory look. Perhaps I can think of something clever :-|
Thanks for responding! Cheers!
On Apr 14, 3:01 am, Andrew France <andrew-li...@odaeus.co.uk> wrote:
> > +--------------------------------------------------+ > > | Name | Title | Spouse | Children | > > +--------------------------------------------------+ > > | John | Accountant | Suzy | John Jr. | > > | George | Watchman | Joan | GeorgetteGeorgina | > > +--------------------------------------------------+
> > But what I'd like is:
> > +--------------------------------------------------+ > > | Name | Title | Spouse | Children | > > +--------------------------------------------------+ > > | John | Accountant | Suzy | John Jr. | > > | George | Watchman | Joan | Georgette | > > | | Georgina | > > +--------------------------------------------------+
> > Or something similar. Any way to do this? I've started looking at > > customizing the Text renderer, but I am wondering if perhaps there is > > an easier way that I've just overlooked.
> I'm afraid as far as I can tell the text formatter code will only output > one row per row in the data table. You could probably iterate over each > row in the data table and create a new row with blank values whenever > you encounter an array value, but that's nasty and still wouldn't be the > exact output you're after. I think joining the array values with a > newline would break the table.
> So yes I think you're right that the best way would be to override the > row builder in the text formatter!
Yeah it's a hard problem that's native to displaying it as text, it wouldn't be so much of an issue in HTML or PDF. Getting the column positioning correct based on the current text formatter will be very difficult so I would hesitate in recommending even subclassing it.
You know, commas are good. :P
One last crazy thought, you could generate the table as HTML then use an HTML to text converter!
> Yes I tried appending a "\n" and it does indeed break the table. OK, > I will look at the row builder...this is probably going to be a fair > amount of work, judging from a cursory look. Perhaps I can think of > something clever :-|
> Thanks for responding! Cheers!
> On Apr 14, 3:01 am, Andrew France<andrew-li...@odaeus.co.uk> wrote:
>>> +--------------------------------------------------+ >>> | Name | Title | Spouse | Children | >>> +--------------------------------------------------+ >>> | John | Accountant | Suzy | John Jr. | >>> | George | Watchman | Joan | GeorgetteGeorgina | >>> +--------------------------------------------------+
>>> But what I'd like is:
>>> +--------------------------------------------------+ >>> | Name | Title | Spouse | Children | >>> +--------------------------------------------------+ >>> | John | Accountant | Suzy | John Jr. | >>> | George | Watchman | Joan | Georgette | >>> | | Georgina | >>> +--------------------------------------------------+
>>> Or something similar. Any way to do this? I've started looking at >>> customizing the Text renderer, but I am wondering if perhaps there is >>> an easier way that I've just overlooked.
>> I'm afraid as far as I can tell the text formatter code will only output >> one row per row in the data table. You could probably iterate over each >> row in the data table and create a new row with blank values whenever >> you encounter an array value, but that's nasty and still wouldn't be the >> exact output you're after. I think joining the array values with a >> newline would break the table.
>> So yes I think you're right that the best way would be to override the >> row builder in the text formatter!
> Yeah it's a hard problem that's native to displaying it as text, it > wouldn't be so much of an issue in HTML or PDF. Getting the column > positioning correct based on the current text formatter will be very > difficult so I would hesitate in recommending even subclassing it.
> You know, commas are good. :P
> One last crazy thought, you could generate the table as HTML then use an > HTML to text converter!
> Regards, > Andrew
> On 14/04/10 23:37, fatcat wrote:
>> Yes I tried appending a "\n" and it does indeed break the table. OK, >> I will look at the row builder...this is probably going to be a fair >> amount of work, judging from a cursory look. Perhaps I can think of >> something clever :-|
>> Thanks for responding! Cheers!
>> On Apr 14, 3:01 am, Andrew France<andrew-li...@odaeus.co.uk> wrote:
>>>> +--------------------------------------------------+ >>>> | Name | Title | Spouse | Children | >>>> +--------------------------------------------------+ >>>> | John | Accountant | Suzy | John Jr. | >>>> | George | Watchman | Joan | GeorgetteGeorgina | >>>> +--------------------------------------------------+
>>>> But what I'd like is:
>>>> +--------------------------------------------------+ >>>> | Name | Title | Spouse | Children | >>>> +--------------------------------------------------+ >>>> | John | Accountant | Suzy | John Jr. | >>>> | George | Watchman | Joan | Georgette | >>>> | | Georgina | >>>> +--------------------------------------------------+
>>>> Or something similar. Any way to do this? I've started looking at >>>> customizing the Text renderer, but I am wondering if perhaps there is >>>> an easier way that I've just overlooked.
>>> I'm afraid as far as I can tell the text formatter code will only output >>> one row per row in the data table. You could probably iterate over each >>> row in the data table and create a new row with blank values whenever >>> you encounter an array value, but that's nasty and still wouldn't be the >>> exact output you're after. I think joining the array values with a >>> newline would break the table.
>>> So yes I think you're right that the best way would be to override the >>> row builder in the text formatter!
>>> Regards, >>> Andrew
> -- > You received this message because you are subscribed to the Google Groups > "Ruby Reports" group. > To post to this group, send email to ruby-reports@googlegroups.com. > To unsubscribe from this group, send email to > ruby-reports+unsubscribe@googlegroups.com<ruby-reports%2Bunsubscribe@google groups.com> > . > For more options, visit this group at > http://groups.google.com/group/ruby-reports?hl=en.