I have two combobox, I let the user to select report criteria FROM xx TO
xx.
i have a button call btnPrint to select report criteria and print
according to the criteria.
I able to SELECT the record based on the report criteria but i dunno
how to print it out with the use of crystal report,because for my
knowledge, Crystal report is only can retrieve all Records in the Table
with generated dataset.
My idea is generated a temporary table, i let user SELECT report
criteria then INSERT all the retrieved record to the temporary table.
after printing i write a delete query to refresh the tempary table.
I have been use this method for printing receipt, but this is bit
different. or any other idea to print it? :confused:
your help is highly appreciate!! :eek: this is emergency..
================================================== ========
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnPrint.Click
ListView1.Items.Clear()
Dim strSQL As String
strSQL = "SELECT * FROM [ItemMaster] WHERE Left(ItemCode,1)
BETWEEN '" & ComboBox1.Text & "' AND '" & ComboBox2.Text & "' ORDER BY
ItemCode"
'strSQL = "SELECT * FROM [ItemMaster] WHERE
Left(ItemCode,1)>='" & ComboBox1.Text & "' AND Left(ItemCode,1)<='" &
ComboBox2.Text & "'"
Dim db As New OleDbCommand(strSQL, dc)
dc.Open()
dr = db.ExecuteReader
While dr.Read
' Im successfully retrieve the record and put in listview
' The problem is how can i INSERT the records has been retrieved to the
temparary table?
Dim lSingleItem As ListViewItem
lSingleItem = ListView1.Items.Add(dr.Item(0))
lSingleItem.SubItems.Add(dr.Item(1))
lSingleItem.SubItems.Add(dr.Item(2))
lSingleItem.SubItems.Add(dr.Item(3))
lSingleItem.SubItems.Add(dr.Item(4))
lSingleItem.SubItems.Add(dr.Item(5))
lSingleItem.SubItems.Add(dr.Item(6))
End While
dr.Close()
dc.Close()
End Sub
--
lea
------------------------------------------------------------------------
lea's Profile:
http://www.msusenet.com/member.php?userid=1569
View this thread:
http://www.msusenet.com/t-1870530570