Page 1 of 1

Hide cross tab columns at run time without occupying space

Posted: Thu Apr 30, 2015 9:01 am
by ryanr.eventpalette
I am using Stimulsoft Reports.Web 2015.1.
Our client requires a report in which columns can be shown/hidden based on user input.
Upon reading your forums, I learned that this can be done using cross tabs.
Indeed, this was achieved by using Conditions to manage the visibility of cross tab column fields
and adding code in the BeforeRender event of the page to manage the visibility of cross tab column headers.
However, even if a cross tab column is hidden/disabled, it still occupies its original space.
Is there a way in which when cross tab column is hidden/disabled, the next columns shifts to the left?
Can a cross tabs column's width be adjusted at run time?
If so, a possible option would be to just change the width of the column to zero and look like it didn't take space at all.
Please advise. Thanks.

Re: Hide cross tab columns at run time without occupying spa

Posted: Thu Apr 30, 2015 9:03 am
by ryanr.eventpalette
Here's a sample report I created which you can use to test.

Re: Hide cross tab columns at run time without occupying spa

Posted: Thu Apr 30, 2015 12:48 pm
by HighAley
Hello.

In your case it's better to use sample project from our Demo how to create better report.
Please, look at the Dialogs - Selecting Column report. You could do the same without dialog.
To avoid blank space you should set the Shift Mode of text components.

Thank you.

Re: Hide cross tab columns at run time without occupying spa

Posted: Mon May 04, 2015 2:37 am
by ryanr.eventpalette
Hello,

I've checked the demo. It works but I'm afraid it doesn't fit the client requirement.

Our client requires a report with 3 sets of columns:
- 1st set contains fixed columns. (e.g. PersonId, FirstName, LastName)
- 2nd set contains optional columns. User may select from X number of optional columns (e.g. City, State, Country, HomePhone, WorkPhone, Mobile).
- 3rd set contains dynamic columns. Number of columns depend on data returned by SQL query (e.g. Would you like to volunteer to Mars? [Yes/No], In your opinion, can jet fuel melt steal beams? [Yes/No]).

Since I had to deal with dynamic columns (3rd set), I thought merely using text components on data bands will not do the trick.
That's the reason why I used cross tabs.
Actually, I had no problems with the 1st set and the 3rd set.
And I was almost able to make the 2nd set work if not for the issue of hidden/disabled columns still occupying space.
Is there a way to achieve our client requirement using cross tabs?
Please advise. Thanks.

Re: Hide cross tab columns at run time without occupying spa

Posted: Mon May 04, 2015 12:59 pm
by HighAley
Hello.

Maybe it's better to create a report in code dynamically?
Please, look at our sample project.

Thank you.