I have an application that I'd like to add the ability to launch reports from a listbox. All it contains is a simple listbox and a button that launches another form containing the crystalreportviewer .net component. The code below is what I have done so far.
I created the list box and added an item to the list. I then created the run report button which launches a new form containing the crystal report viewer, and attempts to apply a .reportsource property based on what item in the listbox is selected.
This launches the new report form, however the report source property does not carry over, instead report simply comes up blank. Am I using the .reportsource property correctly?
Public myCaller As New ReportForm 'name of the second form being launched
Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
If Reportbox.SelectedItem = Nothing Then
MsgBox("Please select a report to run")
If Reportbox.SelectedItem.Equals(repname1) Then
myCaller.CrystalReportViewer1.ReportSource = "C:\Documents and Settings\overtonp\Desktop\Samco Jobs\Crystal Reports\pow103_CUSTOM.rpt"
If myForm Is Nothing Then
myForm = New Form1