For a while I have been using a vbscript to generate a crystal report, providing the input for the single discrete prompt required. Now I need to provide the input for a few other prompts, which are range values.
Currently this is the code I use to provide the prompt input ( full code at end of the post if it is useful to others )
Set crpParamDefs = rep.ParameterFields
For Each crpParamDef In crpParamDefs
With crpParamDef
Select Case .ParameterFieldName
'Now it finds and sets the appropriate stored procedure parameter.
Case "selectcallid"
.SetCurrentValue("00052666"
End Select
End With
Next
I am unsure how to provide a value which is a range, not a discreet value.
Any assistance most appreciated!!
Full Code:
Set appl = CreateObject("CrystalRuntime.Application"
Set rep = appl.OpenReport("z:\supplierissue.rpt", 1)
'This code cycles through the ParameterFieldDefinitions collection in the main report.
'&&&&&&&&&&&&&&&&&&&&
Set crpParamDefs = rep.ParameterFields
For Each crpParamDef In crpParamDefs
With crpParamDef
Select Case .ParameterFieldName
'Now it finds and sets the appropriate stored procedure parameter.
Case "selectcallid"
.SetCurrentValue("00052666"
End Select
End With
Next
rep.EnableParameterPrompting = False
rep.EnableParameterPrompting = False
rep.ExportOptions.DiskFileName = "z:\sr00052666.rtf"
rep.ExportOptions.DestinationType = 1
rep.ExportOptions.PDFExportAllPages = True
rep.ExportOptions.FormatType = 4
rep.Export False
Currently this is the code I use to provide the prompt input ( full code at end of the post if it is useful to others )
Set crpParamDefs = rep.ParameterFields
For Each crpParamDef In crpParamDefs
With crpParamDef
Select Case .ParameterFieldName
'Now it finds and sets the appropriate stored procedure parameter.
Case "selectcallid"
.SetCurrentValue("00052666"
End Select
End With
Next
I am unsure how to provide a value which is a range, not a discreet value.
Any assistance most appreciated!!
Full Code:
Set appl = CreateObject("CrystalRuntime.Application"
Set rep = appl.OpenReport("z:\supplierissue.rpt", 1)
'This code cycles through the ParameterFieldDefinitions collection in the main report.
'&&&&&&&&&&&&&&&&&&&&
Set crpParamDefs = rep.ParameterFields
For Each crpParamDef In crpParamDefs
With crpParamDef
Select Case .ParameterFieldName
'Now it finds and sets the appropriate stored procedure parameter.
Case "selectcallid"
.SetCurrentValue("00052666"
End Select
End With
Next
rep.EnableParameterPrompting = False
rep.EnableParameterPrompting = False
rep.ExportOptions.DiskFileName = "z:\sr00052666.rtf"
rep.ExportOptions.DestinationType = 1
rep.ExportOptions.PDFExportAllPages = True
rep.ExportOptions.FormatType = 4
rep.Export False