Dynamically Hiding and Resizing Table Columns

Stimulsoft Reports.JS discussion
Post Reply
mono
Posts: 5
Joined: Tue Apr 16, 2024 3:29 pm

Dynamically Hiding and Resizing Table Columns

Post by mono »

Hello,
I have a question about hiding table columns.
I use javascript engine to display report.
So i have dynamic result set, which depending on user request can return or not return some columns. I know which columns I need, and I can pass that info through data.
In this example, I created property columns with list of columns that should be displayed, but if there is a better way to do this, I am not bound to this approach.

So in this case, I have data with columns A and C, and I need to dynamically hide column B and I need columns A and C to spread and take the area of column B, like it never existed. How can I achieve this? In some other cases, columns A or C can be missing.


If there is some whole different approach, I am open to all solutions.
Attachments
hide-columns.mrt
(9.38 KiB) Downloaded 9 times
Lech Kulikowski
Posts: 7023
Joined: Tue Mar 20, 2018 5:34 am

Re: Dynamically Hiding and Resizing Table Columns

Post by Lech Kulikowski »

Hello,

Please check the sample report.

Thank you.
Attachments
SelectingColumns.mrt
(787.62 KiB) Downloaded 8 times
mono
Posts: 5
Joined: Tue Apr 16, 2024 3:29 pm

Re: Dynamically Hiding and Resizing Table Columns

Post by mono »

Thanks for that sample. To that part (just hiding) I figured it out myself. But "I need columns A and C to spread and take the area of column B, like it never existed" part I can't figure out.
Can you please provide sample were columns dynamically change width to take space missing by hidden column.

It could be just one column that spreads, but i need table to take whole page width, even when some columns are disabled.
Lech Kulikowski
Posts: 7023
Joined: Tue Mar 20, 2018 5:34 am

Re: Dynamically Hiding and Resizing Table Columns

Post by Lech Kulikowski »

Hello,

Please check the sample report.

Thank you.
Attachments
SelectingColumnsTableComponent.mrt
(787.64 KiB) Downloaded 9 times
Post Reply