deadline and need help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • the_kiddie98@yahoo.com

    #1

    deadline and need help

    Hi Guys,
    I was brought in at the last moment to try to get a project
    completed. it's vb.net and crystal reports.
    Here's the problem
    I can populate a parameter list for a report so the user can choose
    one / all Suppliers. When a parameter option from the combo box is
    clicked that came from the database (see code below) the combo box
    closes but the option is not selected. I have tried every type of case
    I know but still nothing works. the killer is that I have done this
    with a test project and it works fine. I can't see any difference
    though.

    -- code removed
    Dim dataReader As SqlDataReader

    dataReader =
    cmdSuppliers.Ex ecuteReader(Com mandBehavior.Cl oseConnection)

    Dim SuppName As String
    While dataReader.Read
    discreteParam = New ParameterDiscre teValue
    SuppName = dataReader.GetS tring(0)
    discreteParam.V alue = SuppName & " "
    MessageBox.Show (SuppName)
    defaultValues = paramField.Defa ultValues
    defaultValues.A dd(discretePara m)
    ' Apply the default parameter values.
    paramField.Appl yDefaultValues( defaultValues)
    End While

    discreteParam = New ParameterDiscre teValue
    discreteParam.V alue = "test"
    defaultValues = paramField.Defa ultValues
    defaultValues.A dd(discretePara m)
    ' Apply the default parameter values.
    paramField.Appl yDefaultValues( defaultValues)
    if there are any omissions it's in the copy as the report compiles
    fine. "Test" is displayed no problems but any value from the database
    isn't.

    Any help or suggestions would be greatly appreciated.

    Best regards,

    john

  • Graham Parker [MVP]

    #2
    Re: deadline and need help

    Hi John,

    Do you think this is a problem with your code, or a problem with the Crystal
    Reporting Engine?

    If it is down to the report engine, then you may want to try a different
    newsgroup.

    I found your description below very hard to decipher, if you have an update
    on your situation please reply and we'll try and get you some help.

    Best wishes
    Graham Parker.
    <the_kiddie98@y ahoo.com> wrote in message
    news:1129736523 .737082.91370@z 14g2000cwz.goog legroups.com...[color=blue]
    > Hi Guys,
    > I was brought in at the last moment to try to get a project
    > completed. it's vb.net and crystal reports.
    > Here's the problem
    > I can populate a parameter list for a report so the user can choose
    > one / all Suppliers. When a parameter option from the combo box is
    > clicked that came from the database (see code below) the combo box
    > closes but the option is not selected. I have tried every type of case
    > I know but still nothing works. the killer is that I have done this
    > with a test project and it works fine. I can't see any difference
    > though.
    >
    > -- code removed
    > Dim dataReader As SqlDataReader
    >
    > dataReader =
    > cmdSuppliers.Ex ecuteReader(Com mandBehavior.Cl oseConnection)
    >
    > Dim SuppName As String
    > While dataReader.Read
    > discreteParam = New ParameterDiscre teValue
    > SuppName = dataReader.GetS tring(0)
    > discreteParam.V alue = SuppName & " "
    > MessageBox.Show (SuppName)
    > defaultValues = paramField.Defa ultValues
    > defaultValues.A dd(discretePara m)
    > ' Apply the default parameter values.
    > paramField.Appl yDefaultValues( defaultValues)
    > End While
    >
    > discreteParam = New ParameterDiscre teValue
    > discreteParam.V alue = "test"
    > defaultValues = paramField.Defa ultValues
    > defaultValues.A dd(discretePara m)
    > ' Apply the default parameter values.
    > paramField.Appl yDefaultValues( defaultValues)
    > if there are any omissions it's in the copy as the report compiles
    > fine. "Test" is displayed no problems but any value from the database
    > isn't.
    >
    > Any help or suggestions would be greatly appreciated.
    >
    > Best regards,
    >
    > john
    >[/color]


    Comment

    • the_kiddie98@yahoo.com

      #3
      Re: deadline and need help

      Hi Graham,
      This is the first time I have worked with VB.NET and Crystal
      Reports, so I have no idea where the problem lies.
      clarification:
      The values from the database display in the paramet list as any
      hardcoded or generated text. However any value from the database cannot
      be selected in the parameter list (drop down combo), it can be clicked
      on but it is not
      selected. I have tried all castings and adding the database value to a
      string, but nothing works...

      Comment

      • the_kiddie98@yahoo.com

        #4
        Re: deadline and need help

        Hi,
        By chance I figured out the problem. The database field was
        char(100), this seems to be too long to be selected by the parameter
        list. Even though it did display. To fix this problem, simply trim the
        value before using it.

        Hope this saves someone else time.

        Comment

        • The Kiddie

          #5
          Re: deadline and need help

          Hi,
          By chance I figured out the problem. The database field was
          char(100), this seems to be too long to be selected by the parameter
          list. Even though it did display. To fix this problem, simply trim the
          value before using it.

          Hope this saves someone else time.

          All the best



          --
          Sent via .NET Newsgroups

          Comment

          Working...