I am currently developing a csp page that will allow the user to re-run an on-demand report from the viewer by selecting different values for the parameters. However, I want it to start off with the parameters that the user last specified.
What I have written so far opens up a pop-up window and displays the parameters but I cannot get it to display the existing values.
This is the pertinent code that I've nicked from Crystal's own help files somewhere but it only ever returns the "There are no current values for this parameter." message. Has anyone got any ideas?
Dim MyQuery1
MyQuery1 = "SELECT * FROM CI_INFOOBJECTS WHERE SI_ID=" & MyReportID
Dim Result
Set Result = MyInfoStore.Query(MyQuery1)
'Retrieve the report returned.
Dim ReportObject
Set ReportObject = Result.Item(1)
'Retrieve the report interface.
Dim ReportInterface
Set ReportInterface = ReportObject.PluginInterface
'Display the default values for the first parameter in a report
Dim value
If ReportInterface.ReportParameters.Count > 0 Then
If ReportInterface.ReportParameters.Item(1).CurrentValues.Count > 0 Then
Response.Write "The default values for the first parameter in this report are: <BR>"
For each value in ReportInterface.ReportParameters.Item(1).CurrentValues
Response.Write " " & value.MakeDisplayString & "<BR>"
Next
Else
Response.Write "There are no current values for this parameter. <BR>"
End If
Else
Response.Write "This report does not have any parameters.<BR>"
End If
What I have written so far opens up a pop-up window and displays the parameters but I cannot get it to display the existing values.
This is the pertinent code that I've nicked from Crystal's own help files somewhere but it only ever returns the "There are no current values for this parameter." message. Has anyone got any ideas?
Dim MyQuery1
MyQuery1 = "SELECT * FROM CI_INFOOBJECTS WHERE SI_ID=" & MyReportID
Dim Result
Set Result = MyInfoStore.Query(MyQuery1)
'Retrieve the report returned.
Dim ReportObject
Set ReportObject = Result.Item(1)
'Retrieve the report interface.
Dim ReportInterface
Set ReportInterface = ReportObject.PluginInterface
'Display the default values for the first parameter in a report
Dim value
If ReportInterface.ReportParameters.Count > 0 Then
If ReportInterface.ReportParameters.Item(1).CurrentValues.Count > 0 Then
Response.Write "The default values for the first parameter in this report are: <BR>"
For each value in ReportInterface.ReportParameters.Item(1).CurrentValues
Response.Write " " & value.MakeDisplayString & "<BR>"
Next
Else
Response.Write "There are no current values for this parameter. <BR>"
End If
Else
Response.Write "This report does not have any parameters.<BR>"
End If