Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Runtime Parameters from VB6 to CE9

Status
Not open for further replies.

MJRBIM

MIS
May 30, 2003
1,579
CA
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top