Results 1 to 7 of 7

Thread: [RESOLVED] VS 2005 CR11 ParameterFields.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    426

    Resolved [RESOLVED] VS 2005 CR11 ParameterFields.

    I would like to send my dates(startDate,endDate) to CR from VB.NET but i am getting a problem with showing the report after creating the parameterfileds.

    I Add a New Parameter dteStart(no prompting text,type string ).

    Ok. from my form i try to pass values to it like this.
    VB Code:
    1. rdReport.ParameterFields.Item(1).CurrentValues.Clear()
    2. rdReport.ParameterFields.Item(1).CurrentValues.AddValue(Me.dteStart.txt)
    At first i thought it was the way i was passing values to it that kept it prompting me to enter the values,but when i comment the above code, it still prompts me.

    What i need to know is the way am creating parameterFields the right way!!
    Any Help.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: VS 2005 CR11 ParameterFields.

    try
    VB Code:
    1. rdReport.SetParameterValue("paramnamehere",Me.dteStart.txt)

    however is the param itself a date field in CR or text? you may need to cast your text as a date if its a date field (or CR may do it for you.. I can't remember)

  3. #3
    Lively Member
    Join Date
    Mar 2006
    Posts
    94

    Re: VS 2005 CR11 ParameterFields.

    Quote Originally Posted by kleinma
    try
    VB Code:
    1. rdReport.SetParameterValue("paramnamehere",Me.dteStart.txt)

    however is the param itself a date field in CR or text? you may need to cast your text as a date if its a date field (or CR may do it for you.. I can't remember)
    CR datatypes are explicit. It wants exactly what it expects. I'd cast a date as a string and make the parameter a string type if it's not used for anything just to keep it simple.
    Energy can be neither created not destroyed. It can only be wasted.

    Red Green

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    426

    Re: VS 2005 CR11 ParameterFields.

    It pops up a dialogbox telling me to enter a value for the parameter dteStart.
    let the value be a simple text.

  5. #5
    Lively Member
    Join Date
    Mar 2006
    Posts
    94

    Re: VS 2005 CR11 ParameterFields.

    Quote Originally Posted by maps
    It pops up a dialogbox telling me to enter a value for the parameter dteStart.
    let the value be a simple text.
    OK then. How about trying:

    rdReport.ParameterFields.GetItemByName("PARAM_NAME").AddCurrentValue cstr(dteStart.txt)

    Thats the method I use, but I haven't looked at version XI yet.

    HTH
    Energy can be neither created not destroyed. It can only be wasted.

    Red Green

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    426

    Re: VS 2005 CR11 ParameterFields.

    Ohhh Sorry, i think i mis-informed you. I think i am looking at passing a value to an unbound text field on CR.
    The problem VS 2005 comes with CR 10, but since i have CR XI, i create my reports out of VS IDE and just add them to my project. Unlike in the CR Designer, in the IDE "unbound Fields" group is present.so from there i can drag an unbound string and drop it to my Report.

    so now i am looking for a way of passing a value to an unbound field from a textbox on my form.
    Any Idea?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    426

    Re: VS 2005 CR11 ParameterFields.

    Resoolved. Thanks

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