NEW3.00.08 · Released 21 September 2017
NEWfinPOWER Connect
Released in
3.00.08
21 September 2017
  1. Opened21 Aug
  2. Closed21 Aug
  3. Released21 Sep
Article 14830 Job J019503

Report Templates; Scripting; ISGroupingItems; Added "Remove" method

Adding a custom grouping to a Report Template via code has been simplified by allowing items to be removed from an ISGroupingItems object.

For example, the following code would work but, if the Report was re-run via the button on the Report Preview form, the "Group" caption would be lost and replaced with "CustomGroup":

Select Case eventId
  Case "AfterParametersFinalise"
      If Not Parameters.GetGroupingItems("Groupings").Exists("CustomGroup") Then
        Parameters.GetGroupingItems("Groupings").Add("CustomGroup", False, "Group")
      End If
End Select

The following code avoids this issue:

Select Case eventId
  Case "AfterParametersFinalise"
    With Parameters.GetGroupingItems("Groupings")
      .Remove("CustomGroup")
      .Add("CustomGroup", False, "Group")        
    End With
End Select