Results 1 to 2 of 2

Thread: Passing parameter to crystal from VB

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Santo Domingo,D.N., Dom. Rep.
    Posts
    707

    Passing parameter to crystal from VB

    am trying 2 pass a parameter to crystalreport in VB
    With reporte
    s = " id='" & CStr(iid) & "'"
    .ParameterFields(0) = s
    .ReportFileName = "\\xx.x.x.x\Reportes\Suscripciones" & "\" & "Contracto de Suscripcion1.rpt"
    .Action = 1
    End With

    where par(0) is a number and a parameter in crystal.
    I got the message: Invalid parameter name.
    what is wrong?
    How can i do it?

    I mean, when i call the report i need to pass the formula, but the i do not want that the parameter screen to be displayed.

  2. #2
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381
    I use CR9 and this is how I do it:


    VB Code:
    1. Dim CRXParamDefs As CRAXDRT.ParameterFieldDefinitions
    2.       Dim CRXParamDef As CRAXDRT.ParameterFieldDefinition
    3.       Set CRXParamDefs = crxReport.ParameterFields
    4.      
    5.       'DISABLE PROMPTING
    6.       crxReport.EnableParameterPrompting = False
    7.    
    8.       For Each CRXParamDef In CRXParamDefs
    9.          With CRXParamDef
    10. 'GET THE PARAMETER NAME
    11.             Select Case .ParameterFieldName
    12.                Case "@ServiceTimeLine"
    13. 'SET THE VALUE (REPORT_PRMx is a Variable)
    14.                   .SetCurrentValue REPORT_PRM2
    15.                Case "@FormCode"
    16.                   .SetCurrentValue REPORT_PRM1
    17.             End Select
    18.          End With
    19.       Next

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width