Hi,
I have a module, with 2 forms, it has Crystal Report and DataGridView(both visible=False),
Also, the mainform has a listview to which the user will select what type of report to process, then the second form (ReportOpt) appears, the user will then input date and click process.. and the sendc form(
ReportOpt
closes or is hidden,
After processing, depending on what type of report the user has selected from the listview, record should appear either on the crystal or in the DGV..
But, cant see the processed records, even the crystal or dgv is still invisible...
[EDIT]Text below was moved from comment - LOSMAC[/EDIT]
Call DBMain()
ComboBox1.Text = "KRW"
frmdata03.Show()
frmtxn01.Hide()
frmdata04.Hide()
ReportMain.Hide()
Call GR01(TextBox4.Text, TextBox5.Text, ComboBox1.Text, frmdata03.DataGridView1)
Close()
frmdata03.DataGridView1.Width = 752
frmdata03.DataGridView1.Height = 619
frmdata03.DataGridView1.Visible = True
frmdata03.Button1.Visible = True
This is the code inside the method RSP_GR01 is a stored procedure
Public Function GR01(ByVal findate1 As String, ByVal finddate2 As String, ByVal findbr As String, ByRef dgv As DataGridView)
Dim con As New SqlConnection
Dim str As String = Configuration.ConfigurationManager.ConnectionStrings("mbmisConnectionString").ConnectionString
con.ConnectionString = str
con.Open()
Dim comm As SqlCommand = New SqlCommand("RSP_GR01", con)
comm.CommandType = CommandType.StoredProcedure
Dim objParam As SqlParameter
objParam = comm.Parameters.Add("@fromdate", SqlDbType.NVarChar, 10)
objParam.Direction = ParameterDirection.Input
objParam.Value = findate1
objParam = comm.Parameters.Add("@toDate", SqlDbType.NVarChar, 10)
objParam.Direction = ParameterDirection.Input
objParam.Value = finddate2
objParam = comm.Parameters.Add("@branch_CD", SqlDbType.NVarChar, 4)
objParam.Direction = ParameterDirection.Input
objParam.Value = findBr comm.ExecuteNonQuery()
Dim da As SqlDataAdapter = New SqlDataAdapter(comm)
Dim myds As New DataSet
da.Fill(myds)
dgv.DataSource = myds.Tables(0).DefaultView
End Function