How To…Create Conditional Columns

Question

“How can I show multiple columns in certain cases, then revert back to a single column in other cases in the same report?”

Solution

Use x number of child subreports to act as each column, and a single full width subreport to act as the single column.  Then toggle the visibility of each subreport based on how many columns you would like to display for that particular detail.

Download: ConditionalColumnsUsingSubreports.zip

Sample Delphi code: