Search code examples
vb6crystal-reports

Crystal Reports - change group header suppress formula programmatically


Using Crystal Reports 10 and vb6/classic (although I expect its the same in any language), is it possible to change a suppression formula on a Group header section dynamically from code.

I'm basically changing the GroupConditionField on a specific group dynamically according to user input, but on that group header there is a suppression field formula containing a check on a grouped sum.

Sum ({@ColourTotal}, {Table.Field}) =0

If this is true, the group gets suppressed. This obviously comes up with an error complaining it can't find the group when the GroupConditionField is changed through code.

So is there a way to change the suppress formula for a specific group from within code?


Solution

  • I believe I have found a way to do it using the Group Selection Formula under Report->Selection Formulas-> Group inside the actual report.

    Not ideal and will involve some reformatting but should work.