Hide/show columns

Stimulsoft Reports.JS discussion
Post Reply
ga6riel
Posts: 10
Joined: Mon May 13, 2019 1:58 pm

Hide/show columns

Post by ga6riel »

Hello,

How can I hide/show a column inside a Table component by JavaScript code?

I tried to do it this way to hide a column:

Code: Select all

const hdrName = this.report.getComponentByName('hdrName')
hdrName.enabled = false;
The property was setted to false but the column still remains visible.

Thanks.
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: Hide/show columns

Post by Lech Kulikowski »

Hello,

Unfortunately, it is not possible for the Table component. Please try to use DataBand with Text components.

Thank you.
ga6riel
Posts: 10
Joined: Mon May 13, 2019 1:58 pm

Re: Hide/show columns

Post by ga6riel »

Hello,

It seems that I am still not able to hide a column within the DataBand...

I am doing this:

Code: Select all

const Dataroot = this.report.getComponentByName('Dataroot');
Dataroot.components.getByName('datBreed').enabled = false;

this.viewer.report = this.report;
this.viewer.renderHtml("viewerContent");
But the column remains visible... Maybe I'm accessing the Databand columns in the wrong way...

Dataroot is a DataBand and datBreed is a text component.
Lech Kulikowski
Posts: 7291
Joined: Tue Mar 20, 2018 5:34 am

Re: Hide/show columns

Post by Lech Kulikowski »

Hello,

Please send us a sample project which reproduces the issue for analysis.

Thank you.
Post Reply