Displaying and changing whether a parameter is null

This example selects the first report it finds, and then examines and modifies the first value of the first parameter.


<%

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


If ReportInterface.ReportParameters.Count > 0 Then

    If ReportInterface.ReportParameters.Item(1).DefaultValues.Count > 0 Then

        If ReportInterface.ReportParameters.Item(1).DefaultValues.Item(1).IsNull Then

            Response.Write "The value is Null."

        Else

            Response.Write "The value is not Null and is being changed."

            ReportInterface.ReportParameters.Item(1).DefaultValues.Item(1).IsNull= _

                TRUE

                'The line below has been removed in this example to avoid changing any

                'report properties on your machine.

                'IStore.Commit Result

                If Err.Number <> 0 Then

                    Response.Write "<BR>The changes could not be " & _

                "made on the server."

                Else

                    Response.Write "<BR>The changes were " & _

            "successfully made on the server."

            End If

        End If

    Else

        Response.Write "This parameter does not have any default values."

    End If

Else

    Response.Write "This report does not have any parameters."

End If

%>




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