Skip to main content

Hi all,

 

When creating a report, I want empty columns to be hidden in a report. However, I am struggling to find the right way to get this working. 

At this moment, I have created a reporting page that allows users to select parameters that are needed in a report. When a parameter is selected, the view query gathers the values of the parameter. However, when a parameter is not selected, the view sets the value of the parameter to null. In terms of code, this works fine. The problem occurs when the report is created.

DevExpress makes it quite difficult to hide columns based upon the value of the column, but I have succeeded in this. However, I want the next column to take the place of the hidden column in order to have a clean looking report. This is where I am struggling to find the right solution.

Thanks in advance.

Hi Mark,

As far as I know it is not possible to hide columns and then have other columns move up over this column.

What I usually do is, work with hiding sections based on conditions instead of columns. This allows you to place different columns on the same position of your document and based on the condition you only display the section with the correct format for the specific scenario.

Another way to place different columns on the same position is that you place all these columns on the same location in your document and you hide them based on conditions, resulting in always showing just 1 of these columns at the time. So based on the different condition there can only be 1 column that is visible. All of the others will be hidden. This solution is the less preferred solution compared to working with the different sections.


Hi Arjan,

What do you mean with sections? Do you perhaps have an example?

I my case I want columns to be removed/hidden based on the condition that the view generates the columns as empty when the parameter is not selected. I have managed to use this condition to set the width of the columns to 0 and the following column to take the place of the hidden column. However, the column still exists, only with a width of 0.


As I understand it, you can create multiple sections which divide your report into multiple areas, and determine for each section whether it should be shown or not.

However, this seems more like a DevExpress-specific question, so you might find more help in their Community/Documentation. Perhaps this is a good starting point: https://docs.devexpress.com/WindowsForms/89/controls-and-libraries/printing-exporting/concepts/basic-terms/document-sections.

Please let us know if you have any follow-up questions related to Thinkwise on this topic.


Reply