deadline and need help

  • Thread starter Thread starter the_kiddie98
  • Start date Start date
T

the_kiddie98

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.ExecuteReader(CommandBehavior.CloseConnection)

Dim SuppName As String
While dataReader.Read
discreteParam = New ParameterDiscreteValue
SuppName = dataReader.GetString(0)
discreteParam.Value = SuppName & " "
MessageBox.Show(SuppName)
defaultValues = paramField.DefaultValues
defaultValues.Add(discreteParam)
' Apply the default parameter values.
paramField.ApplyDefaultValues(defaultValues)
End While

discreteParam = New ParameterDiscreteValue
discreteParam.Value = "test"
defaultValues = paramField.DefaultValues
defaultValues.Add(discreteParam)
' Apply the default parameter values.
paramField.ApplyDefaultValues(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
 
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.
 
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...
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top