Running VB6 and Crystal Enterprise 9.
One of the VB6 developers is trying to run a sample report in CE which has one numeric parameter named ProblemNo.
If he uncomments the line 'IStore.Commit Result, then the DEFAULT parameter value is updated in CE and the report displays using the new parameter value. But, we would like to be able to be able to set the parameter value at run time, just for a single instance of the report. Here is the code that he is using:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Set Result = IStore.Query("Select * From CI_INFOOBJECTS Where " & _
"SI_ID = '1102' and SI_INSTANCE = 0 "
Set ReportObject = Result.Item(1)
Set ReportInterface = ReportObject.PluginInterface
Set CurrentValues = ReportInterface.ReportParameters.item(1).CurrentValues
CurrentValues.Clear()
Set NewSingleParam = ReportInterface.ReportParameters.item(1).CreateSingleValue
NewSingleParam.Value = "78000"
ReportInterface.ReportParameters.Item(1).CurrentValues.Add NewSingleParam
Set rptFactory = iStore.EnterpriseSession.Service("", "PSReportFactory"
Set rptSource = rptFactory.OpenReportSource(ReportObject)
'IStore.Commit Result
Set viewer1 = Server.CreateObject("CrystalReports.CrystalReportViewer"
With viewer1
.ReportSource = rptSource
'.reportsource = ReportObject
.EnterpriseLogon = iStore.EnterpriseSession
.URI = CStr( Request.ServerVariables.Item("PATH_INFO" & "?" & Request.ServerVariables.Item("QUERY_STRING")
End With
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Thanks in advance!
One of the VB6 developers is trying to run a sample report in CE which has one numeric parameter named ProblemNo.
If he uncomments the line 'IStore.Commit Result, then the DEFAULT parameter value is updated in CE and the report displays using the new parameter value. But, we would like to be able to be able to set the parameter value at run time, just for a single instance of the report. Here is the code that he is using:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Set Result = IStore.Query("Select * From CI_INFOOBJECTS Where " & _
"SI_ID = '1102' and SI_INSTANCE = 0 "
Set ReportObject = Result.Item(1)
Set ReportInterface = ReportObject.PluginInterface
Set CurrentValues = ReportInterface.ReportParameters.item(1).CurrentValues
CurrentValues.Clear()
Set NewSingleParam = ReportInterface.ReportParameters.item(1).CreateSingleValue
NewSingleParam.Value = "78000"
ReportInterface.ReportParameters.Item(1).CurrentValues.Add NewSingleParam
Set rptFactory = iStore.EnterpriseSession.Service("", "PSReportFactory"
Set rptSource = rptFactory.OpenReportSource(ReportObject)
'IStore.Commit Result
Set viewer1 = Server.CreateObject("CrystalReports.CrystalReportViewer"
With viewer1
.ReportSource = rptSource
'.reportsource = ReportObject
.EnterpriseLogon = iStore.EnterpriseSession
.URI = CStr( Request.ServerVariables.Item("PATH_INFO" & "?" & Request.ServerVariables.Item("QUERY_STRING")
End With
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Thanks in advance!