Does anyone know how to set the maximum and minimum values of a range type
parameter field in code.
The code I have so far is..
* Create the CR Object
LOCAL loCr AS CRAXDRT.APPLICATION
loCr = CREATEOBJECT("CrystalRuntime.Application")
* Open the report
loCrRpt = loCr.OpenReport(ALLTRIM(sp_ReportPath) +
"\"+ALLTRIM(treports.CODE)+STRTRAN(STR(treports.VERSION,3)," ","0")+".rpt")
* Create the Database object
oDB = loCrRpt.Database()
* Get a references to the DatabaseTables collection
ocDbt = oDB.Tables(1)
* set the datasource of the report
FOR EACH cPProperty IN ocDbt.connectionproperties
IF cPProperty.name = "Data Source"
cPProperty.value = gcDataPath
endif
endfor
loCrRpt.DiscardSavedData()
ocParm = loCrRpt.ParameterFields()
oParm = ocParm.GetItemByName("cust")
oParm.SetCurrentValue(lcCustFrom)
oParm.AddCurrentValue(lcCustTo)
This sets the start of the range value but produces an error when the
addcurrentvalue() line runs.
The error says the parameter is not range. I have checked the parametr and
it si a range type parameter. The data type is string.
Thanks in advance
Dave