Dynamically Change Height of Detail section

158 views
Skip to first unread message

Teerawat Wuttiwat

unread,
Oct 21, 2015, 11:38:47 PM10/21/15
to Thinreports
Hi All,

First of all, thank you so much for creating this report tools.
I am not sure that this is the right group to post the question or not.
Please let me know if I need to post to other groups.

Here is my situation.
I am working on one invoice report similar to 'Estimate' example.

One different is that, each line item can have varying size of description.
For example,  one simple item A with just one line might be like this

---------------------
1 | Item A| 100 |
---------------------

Another item (B) might have longer description
---------------------
1 | Item A| 100 |
   | Foo    |        |
   | Bar     |        |
---------------------

This description is dynamically change by client (i.e. it would not known before hand).
So height of each detail section need to be computed dynamically.

Could you please suggest me how to accomplish this?
I try to read from documentation but still could not found the solution yet.

BTW, I did try to change Text 'Overflow' property to 'Shrink to Fit'.
But the result text is too small.

Thank you so much,

Teerawat

Takuo

unread,
Oct 23, 2015, 11:51:43 AM10/23/15
to Thinreports
Hi, Teerawat.

---
Note: I am not good at English. From Japanese to English by Google translation has posted what has been translated.
---

Unfortunately, it is not possible to change the height of the detail section in Thinreports. As shown in the following example, the height of all of the detail section must be the same.

OK:
---------------------
1 | Item A | 100 |
---------------------
2 | Item B | 200 |
---------------------

NG:
---------------------
1 | Item A| 100 |
   | Foo    |        |
   | Bar     |        |
---------------------
2 | Item B | 200 |
---------------------

However, PDF generation of "thinreports-generator" is running the "prawn". Therefore, it is want to your implementation, it may be realized by using the "prawn".

Or, since there are several RubyGems to convert HTML to PDF, it may be better to use them.

Thank you.

2015年10月22日木曜日 12時38分47秒 UTC+9 Teerawat Wuttiwat:

Teerawat Wuttiwat

unread,
Oct 25, 2015, 2:34:15 PM10/25/15
to Thinreports
Hi, Takuo

Thank you so much for your quick reply. I am really appreciated it.
One quick question, could you please show me how to get the reference of "prawn" from "thinreports-genetorator"

Thank you very much,

Teerawat

Jose Manuel Martinez

unread,
Oct 24, 2017, 11:32:37 AM10/24/17
to Thinreports
First I want to thank every one on this project, it is really wonderful.
I was wondering Teerawat could make it done, or you could not make it works

Miércoles, 21 de octubre de 2015 22:38 47 segundos UTC - 5 Teerawat Wuttiwat:
Hola a todos,

Antes que nada, muchas gracias por crear estas herramientas de informe.
No estoy seguro de que este sea el grupo correcto para publicar la pregunta o no.
Por favor, avíseme si necesita publicar en otros grupos.

Aquí está mi situación.
Estoy trabajando en un informe de factura similar al ejemplo de 'Estimación'.

Uno diferente es que cada elemento de línea puede tener diferentes tamaños de descripción.
Por ejemplo, un simple elemento A con solo una línea podría ser así

---------------------
1 | Artículo A | 100 |
---------------------

Otro artículo (B) podría tener una descripción más larga
---------------------
1 | Artículo A | 100 |
   | Foo |
   | Bar |
---------------------

Esta descripción es cambiada dinámicamente por el cliente (es decir, no se conocía de antemano).
Por lo tanto, la altura de cada sección de detalle debe calcularse dinámicamente.

¿Podría por favor sugerirme cómo lograr esto?
Intento leer de la documentación, pero todavía no pude encontrar la solución.

Por cierto, intenté cambiar la propiedad Text 'Overflow' a 'Shrink to Fit'.
Pero el texto del resultado es demasiado pequeño.

Muchas gracias

Teerawat
Reply all
Reply to author
Forward
0 new messages