Results 1 to 5 of 5

Thread: problems passing parameters

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    90

    problems passing parameters

    I am using Crystal Reports 10 and Visual Studio 2005 (vb.net). I have created a report and need to pass it parameters. Below is the code I am using. On the line ParamField = ParamFields("Department"), I am getting the error System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.

    If I don't try and sent parameters the report load fine. Does anyone know what could cause this?

    Dim ParamValue As New ParameterDiscreteValue
    Dim ParamFields As CrystalDecisions.Shared.ParameterFields
    Dim ParamField As CrystalDecisions.Shared.ParameterField


    ParamFields = CrystalReportViewer1.ParameterFieldInfo
    ParamField = ParamFields("Department")

    ParamValue.Value = hospital.SelectedValue
    ParamField.CurrentValues.Add(ParamValue)

  2. #2
    Hyperactive Member Chathura's Avatar
    Join Date
    Nov 2005
    Location
    Sri Lanka
    Posts
    345

    Re: problems passing parameters

    Have you created the parameter ("Department")in the crystal report in the design time?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2006
    Posts
    90

    Re: problems passing parameters

    There is a parameter named Department in the report. What do you mean by "in the design time"?

  4. #4
    Addicted Member mabbas110's Avatar
    Join Date
    Oct 2005
    Location
    Karachi , Pakistan
    Posts
    172

    Re: problems passing parameters

    Just do one experiment , dont pass it as a parameter , just directly pass it into a formula field and see what its passing , may be u can find some mistake in it.
    Thanks and Regards,

    Muhammad Abbas

  5. #5
    Hyperactive Member Chathura's Avatar
    Join Date
    Nov 2005
    Location
    Sri Lanka
    Posts
    345

    Re: problems passing parameters

    Quote Originally Posted by vlntine82
    What do you mean by "in the design time"?
    I meant when you designing the report.
    Anyway if the department is added to your report as a parameter field there must be some other problem.
    Last edited by Chathura; Jan 12th, 2007 at 02:07 AM.

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