creating and populating a crystal report using a dataset and text boxes
Posted on 2006-04-20
I'm new at using VB.net and I have a form that clears and fills a dataset upon a change in text in a text box on my form. I'd like to print a crystal report after clicking on the print command button. I'm using visual studio 2002 and the crystal reports that came with it. I've reviewed quite a few previously posted solutions and have become more confused with the different approaches. I've attached the database connection, the data adapter and the dataset to the form and placed this code in the "txtNDC_TextChanged" for the text box
' Get the Parameter object and Set value
.Item("@ndcparam").Value = _
' Clear the dataset
' Load the dataset using the parameter value
Catch ex As Exception
It fills the dataset as I have two other objects displaying information from the datset after it updates.
Now generally a user will enter information into two other text boxes and hit print.
When they hit print I'd like the report to automatically print at the printer, without the user visibly having to look at it.
I've reviewed a link to a solution "vbnet_win_pass_dataset_main_sub" and couldn't figure out how he created the report without an actual connection through the designer. Although the solution works fine and does what it's supposed to when I run it.
Thanks in advance