Search code examples
vb.netwinformsparameterscrystal-reports

vb.net Crystal Reports - Parameters


just a quick one this...

Is it possible to programatically get a list of parameters from a crystal report class?

Any help/advice would be much appreciated.

Thank you in advance.


Solution

  • Assuming rpt is a CrystalDecisions.CrystalReports.Engine.ReportDocument:

    Dim param As CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition
    For Each param In rpt.DataDefinition.ParameterFields
        'You can get the name with this
        'param.Name
    
        'You can set the value like this
        rpt.SetParameterValue(param.Name, "Your Value")
    Next