How to hide certain columns of Data source?

Stimulsoft Reports.NET discussion
Post Reply
theregister
Posts: 53
Joined: Wed Nov 27, 2013 5:24 pm

How to hide certain columns of Data source?

Post by theregister »

If my Data source has 10 fields, 5 of which are calculated columns, and the other 5 are the ones used to calculate the calculated columns, I want to only show the calculated ones on the Data source on the dictionary. I want the other 5 to remain hidden if possible, not gone, but hidden, is this possible?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: How to hide certain columns of Data source?

Post by Alex K. »

Hello,

You can use the following code:

Code: Select all

report.Dictionary.Restrictions.Add("ColumnName", StiDataType.DataColumn, StiRestrictionTypes.DenyShow)
Thank you.
theregister
Posts: 53
Joined: Wed Nov 27, 2013 5:24 pm

Re: How to hide certain columns of Data source?

Post by theregister »

It is not necessary to specify the data source? What if 2 different data sources have the same name column, and only one of them needs to be hidden?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: How to hide certain columns of Data source?

Post by Alex K. »

Hello,

You can use the following code, as example:
report.Dictionary.Restrictions.Add("Categories.CategoryID", StiDataType.DataColumn, StiRestrictionTypes.DenyShow);

Thank you.
theregister
Posts: 53
Joined: Wed Nov 27, 2013 5:24 pm

Re: How to hide certain columns of Data source?

Post by theregister »

What is this supposed to do? I can still see the column after I've applied this DenyShow restriction on the report, it's still on the dictionary and on the report if I select it.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: How to hide certain columns of Data source?

Post by Alex K. »

Hello,

Please send us a sample project with test data which reproduce the issue for analysis.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to hide certain columns of Data source?

Post by HighAley »

Hello.

This code works right. We have checked it once again. Maybe you do something wrong.
Could you send us more information about this issue?

Thank you.
Post Reply