I use the Search function
Code: Select all
Public Function GetDataSet(ByVal cmdText As String) As DataSet
mSqlCommand.Connection = mConnection
mSqlCommand.CommandType = CommandType.StoredProcedure
mSqlCommand.CommandText = cmdText
Using Adapter As New SqlDataAdapter
Adapter.SelectCommand = mSqlCommand
Dim ds As New DataSet
Adapter.Fill(ds)
Return ds
End Using
End Function
Code: Select all
Dim Ds_Documents As New DataSet
Code: Select all
Private Sub UiButton1_Click(sender As Object, e As EventArgs) Handles UiButton1.Click
Try
Using db As New GeneralDataBase
With db
Dim FromDate As String = txtFromDate.Text
Dim ToDate As String = txtToDate.Text
GridEX1.RemoveFilters()
.ClearParameters()
.AddParameters("FromDate", SqlDbType.VarChar, FromDate)
.AddParameters("ToDate", SqlDbType.VarChar, ToDate)
Ds_Documents = .GetDataSet("Get_Dynamic_Documents")
If Ds_Documents.Tables(0).Rows.Count <= 0 Then
MessageBox.Show("No data found ")
GridEX1.DataSource = Nothing
txtFromDate.SetNow = True
txtToDate.SetNow = True
txtFromDate.Focus()
Exit Sub
End If
Me.GridEX1.DataSource = Ds_Documents.Tables(0)
End With
End Using
Catch ex As Exception
MessageBox.Show(ex.Message, "SystemError", MessageBoxButtons.OK, MessageBoxIcon.Error)
GridEX1.DataSource = Nothing
txtFromDate.SetNow = True
txtToDate.SetNow = True
txtFromDate.Focus()
End Try
End Sub
ِAnd This code is printed output
Code: Select all
StiReport1.Load("C:\Users\Dev\Desktop\my_rpt\Archive\xx.mrt")
StiReport1.Dictionary.Databases.Clear()
StiReport1.Dictionary.DataSources.Clear()
StiReport1.RegData(Ds_Documents)
StiReport1.Dictionary.Synchronize()
StiReport1.Show()