Table Auto Width with Header Bands
Table Auto Width with Header Bands
Hello,
I need to create a report with a grouped table layout. For this I have added some header/footer bands and a table component. The table uses the properties "AutoWidth=True" and "AutoWidthType=Table".
But now I have some problems:
1) I need to define a minimal width for some columns.
2) I need a AutoWidth property for the total fields in the footer bands so that they are placed on the same position as the table columns.
Please see attachment for an example.
Many Thanks & Regards,
Matthias
I need to create a report with a grouped table layout. For this I have added some header/footer bands and a table component. The table uses the properties "AutoWidth=True" and "AutoWidthType=Table".
But now I have some problems:
1) I need to define a minimal width for some columns.
2) I need a AutoWidth property for the total fields in the footer bands so that they are placed on the same position as the table columns.
Please see attachment for an example.
Many Thanks & Regards,
Matthias
- Attachments
-
- GroupedTable.zip
- (18.57 KiB) Downloaded 530 times
Re: Table Auto Width with Header Bands
Hello, Matthias.
Unfortunately, there is no way to set minimum size of the cells.
Please, try to use Data Band with Text components.
You could set Min and Max Size there and use Auto Width.
To change the size of text components on Group Footer you should write scripts that will save width of components for the group in a variable.
Thank you.
Unfortunately, there is no way to set minimum size of the cells.
Please, try to use Data Band with Text components.
You could set Min and Max Size there and use Auto Width.
To change the size of text components on Group Footer you should write scripts that will save width of components for the group in a variable.
Thank you.
Re: Table Auto Width with Header Bands
Hello Alekey,
thank you for your reply. I will try your solution, but this seems to be a complicated solution for a simple problem...
Regards,
Matthias
thank you for your reply. I will try your solution, but this seems to be a complicated solution for a simple problem...
Regards,
Matthias
Re: Table Auto Width with Header Bands
Hello,
I have tried to set the width of the text components in the footer with scripts. But this did not work properly.
In what event, I have to set the width? My current problem is, that I don't get the new (resized) width of the table cells...
I hope, you can help me.
Thanks & Regards,
Matthias
I have tried to set the width of the text components in the footer with scripts. But this did not work properly.
In what event, I have to set the width? My current problem is, that I don't get the new (resized) width of the table cells...
I hope, you can help me.
Thanks & Regards,
Matthias
Re: Table Auto Width with Header Bands
Sorry, but this seems to be wrong. In the code, I can set MinSize and MaxSize of Table Cells. I have to set these properties to all cells of the corresponding column and have to set the "FixedWidth" property to true. And it works very wellAleksey Andreyanov wrote: Unfortunately, there is no way to set minimum size of the cells.

But my question, how to get the rendered width of a table cell is still open

Regards,
Matthias
Re: Table Auto Width with Header Bands
Hello, Matthias.
As I wrote before, you should use Data Band with text components on it instead of the Table component.
You could get the Width of rendered component in Get Value event of the component. Get it from sender.
To set the Width use Before Print event of the component where you need to change it.
Thank you.
As I wrote before, you should use Data Band with text components on it instead of the Table component.
You could get the Width of rendered component in Get Value event of the component. Get it from sender.
To set the Width use Before Print event of the component where you need to change it.
Thank you.
Re: Table Auto Width with Header Bands
Hello,
thank you.
But how can I realize an auto-width solution with data band?
If I set the AutoWidth property on all text components in the data band, only the width but not the position of the components will be changed. In the table component, the position depends on the widths of the previous columns.
Is there really no way to get the rendered with of a table cell? This would resolve all my open points!
Many thanks & Regards,
Matthias
thank you.
But how can I realize an auto-width solution with data band?
If I set the AutoWidth property on all text components in the data band, only the width but not the position of the components will be changed. In the table component, the position depends on the widths of the previous columns.
Is there really no way to get the rendered with of a table cell? This would resolve all my open points!
Many thanks & Regards,
Matthias
Re: Table Auto Width with Header Bands
Hello,
Please try to use the DockStyle property for the Text component in this case.
Thank you.
Please try to use the DockStyle property for the Text component in this case.
Thank you.
Re: Table Auto Width with Header Bands
Hello, Mattias.
Sorry, forget to write that you should set the Dock Style to Left.
Then you should set the Number of Pass property of the report to Double Pass.
After this you could store in a variable the width of the widest component at the first pass and set the width to the largest value on the second pass.
Please, look at the attached report template. Thank you.
Sorry, forget to write that you should set the Dock Style to Left.
Then you should set the Number of Pass property of the report to Double Pass.
After this you could store in a variable the width of the widest component at the first pass and set the width to the largest value on the second pass.
Please, look at the attached report template. Thank you.
Re: Table Auto Width with Header Bands
Hello, Aleksey and Aleksey,
I have tried your solution. But now it is possible, that the last column will grow outside the printable area
Please see the attached template. The XML data you'll find in my first post.
Thanks & Regards,
Matthias
I have tried your solution. But now it is possible, that the last column will grow outside the printable area

Please see the attached template. The XML data you'll find in my first post.
Thanks & Regards,
Matthias
- Attachments
-
- GroupedTableReport2.mrt
- (24.69 KiB) Downloaded 395 times