troubleshooting Question

Crystal reports update parameter

Avatar of FCapo
FCapo asked on
Crystal Reports.NET Programming
3 Comments1 Solution135 ViewsLast Modified:
Hi,

I have a crystalreportviewer on my form, I'd like to from a button on the form be able to update my report with a new parameter value once the report is already loaded, is there a way to change the parameter value in realtime through code, such as if I were to press the refresh button?

    
    Dim param1Fileds As New CrystalDecisions.Shared.ParameterFields
        Dim param1Field As New CrystalDecisions.Shared.ParameterField
        Dim param1Range As New CrystalDecisions.Shared.ParameterDiscreteValue

        param1Field.ParameterFieldName = "emp"
        param1Range.Value = "Phil" ' value For Parameter Field 
        param1Field.CurrentValues.Add(param1Range)
        param1Fileds.Add(param1Field)
        CrystalReportViewer1.ParameterFieldInfo = param1Fileds 'to pass parameter inf.to CRV
        CrystalReportViewer1.Refresh()

        Dim param1Fileds1 As New CrystalDecisions.Shared.ParameterFields
        Dim param1Field1 As New CrystalDecisions.Shared.ParameterField
        Dim param1Range1 As New CrystalDecisions.Shared.ParameterDiscreteValue

        param1Field1.ParameterFieldName = "emp"
        param1Range1.Value = "Carl" ' value For Parameter Field 
        param1Field1.CurrentValues.Add(param1Range1)
        param1Fileds1.Add(param1Field1)
        CrystalReportViewer1.ParameterFieldInfo = param1Fileds1 'to pass parameter inf.to CRV
        CrystalReportViewer1.Refresh()
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros