Displaying the group selection formula for a report

This example prints the group selection formula of the first report it finds. If there is no group selection formula it will set one.


<%

On Error Resume Next


'Retrieve InfoStore.

Set IStore = Session("IStore")


'Query for a report.

Set Result = IStore.Query("SELECT Top 1 SI_PROCESSINFO From CI_INFOOBJECTS Where " & _

    "SI_PROGID = 'CrystalEnterprise.Report'")

If (Err.Number <> 0) Then

    Response.Write "Example failed: Try logging on first!<BR>"

End If


'Retrieve the first report returned.

Set ReportObject = Result.Item(1)


'Retrieve the report interface.

Set ReportInterface = ReportObject.PluginInterface

If (Err.Number <> 0) Then

    Response.Write "Example failed: Try logging on first!<BR>"

End If


Formula = ReportInterface.GroupFormula

If Formula = "" Then

    Response.Write "There is no group formula. <BR>"

    Response.Write "The new group formula is being set."

    

    'The line below has been commented out to avoid altering any of your reports.

    'Enter your formula value below.

    'ReportInterface.GroupFormula = "enter_formula_value_here"

    IStore.Commit Result

Else

    Response.Write "The group formula is: " & Formula

End If

%>




Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com