edgarbenilde
Oct 18th, 2007, 03:25 AM
hi, here is my problem...
upon loading my crystal report there is default load data is already display in the
screen even if i didn't assign it yet....
i'm using excel database and i like it to the access then i made querry there and that is what i'm using for this report... called "RSOquerryFinal"
UsePrintRSONO_rpt can have the value upon clicking the print button by getting the RSONO
now, it's should be print the RSONO number that has in my RSO textbox but it is not printing the selected RSONO number instead of having the default data which the first RSONO number in the database...
why is like that? help me please i can't find the where is locking here..
help please..?
now, here is my code
=====================================================
private sub form_load
Dim newRep As New CrystalReportFillBy
OpenConnection()
GetRecords(UsePrintRSONO_rpt)
newRep.SetDataSource(ds)
newRep.Refresh()
CrystalReportViewer1.RefreshReport()
getRsoNoToBePrint()
end sub
Private Sub openconnection()
If cn.State = ConnectionState.Closed Then
cn = New OleDbConnection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\ph-suman\rso\Rsodb.mdb;User Id=admin;Password=;"
cn.Open()
End If
End Sub
Private Sub GetRecords(ByVal UsePrinRSONO As String)
Try
ds = New DataSet
Dim cmd As New OleDbCommand
cmd.Connection = cn
cmd.CommandType = CommandType.Text
cmd.CommandText = "SELECT * from RSOQuerryFinal where RsoNo='" & UsePrinRSONO & "'"
da = New OleDbDataAdapter
da.SelectCommand = cmd
da.Fill(ds, "RSOQuerryFinal")
Catch ex As Exception
MsgBox(ex.ToString)
MsgBox(ex.Message)
End Try
upon loading my crystal report there is default load data is already display in the
screen even if i didn't assign it yet....
i'm using excel database and i like it to the access then i made querry there and that is what i'm using for this report... called "RSOquerryFinal"
UsePrintRSONO_rpt can have the value upon clicking the print button by getting the RSONO
now, it's should be print the RSONO number that has in my RSO textbox but it is not printing the selected RSONO number instead of having the default data which the first RSONO number in the database...
why is like that? help me please i can't find the where is locking here..
help please..?
now, here is my code
=====================================================
private sub form_load
Dim newRep As New CrystalReportFillBy
OpenConnection()
GetRecords(UsePrintRSONO_rpt)
newRep.SetDataSource(ds)
newRep.Refresh()
CrystalReportViewer1.RefreshReport()
getRsoNoToBePrint()
end sub
Private Sub openconnection()
If cn.State = ConnectionState.Closed Then
cn = New OleDbConnection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\ph-suman\rso\Rsodb.mdb;User Id=admin;Password=;"
cn.Open()
End If
End Sub
Private Sub GetRecords(ByVal UsePrinRSONO As String)
Try
ds = New DataSet
Dim cmd As New OleDbCommand
cmd.Connection = cn
cmd.CommandType = CommandType.Text
cmd.CommandText = "SELECT * from RSOQuerryFinal where RsoNo='" & UsePrinRSONO & "'"
da = New OleDbDataAdapter
da.SelectCommand = cmd
da.Fill(ds, "RSOQuerryFinal")
Catch ex As Exception
MsgBox(ex.ToString)
MsgBox(ex.Message)
End Try