I have a small application that I built. In Visual Studio 2005, using VB. It contains one dataset for queries, with 3 seperate queries. The first is based off of a combobox value, second is based off two textbox values for a date range search and the third is based off the combobox value and two textbox values for a more specific date range search.
All 3 of the queries pass their parameters to the same form with the same reportviewer. Everything works fine with one exception. If I do a date range query and pull up the report it will only display the first record from the dataset query. If I preview my query results it shows all the records that are returned. Somehow the other records are getting lost in space.
From my experiance in the past, if multiple records are returned to the reportviewer it will show multiple pages on the toolbar at the top and let you navigate through the records. But it is only showing 1 page on the toolbar and will not let me navigate.
Below is code for one of my queries and the code for loading the report.
Date range query (note i left out all the unessecary columns out just showing the basic functionality)
SELECT D1
FROM Main
WHERE (D1 >= @param) AND (D1 <= @param1)
Button click event from my query selection page that calls my report.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim rptD As New frmQDATE(Me.txtSD.Text, Me.txtED.Text)
rptD.Show()
End Sub
The code on the form that contains the reportviewer which finishes passing my 2 date values to the report.
Public Class frmQDATE
Dim SD As String
Dim ED As String
Private Sub frmQDATE_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'RackInspectionDataSet1.Main' table. You can move, or remove it, as needed.
Me.MainTableAdapter.FillBy(Me.RackInspectionDataSet1.Main, SD, ED)
Me.ReportViewer1.RefreshReport()
End Sub
Public Sub New(ByVal s As String, ByVal e As String)
Try
InitializeComponent()
SD = s
ED = e
Catch ex As Exception
End Try
End Sub
End Class
I am at a loss, any advice would be most helpful. Thanks