以主要形式显示记录 [英] Displaying Records in Main Form

查看:69
本文介绍了以主要形式显示记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个具有2种形式的模块,它具有Crystal Report和DataGridView(均为visible = False),
此外,主窗体还有一个列表视图,用户可以选择要处理的报告类型,然后出现第二个窗体(ReportOpt),然后用户输入日期并单击处理..并且sendc窗体(

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

关闭或隐藏,

处理后,取决于用户从列表视图中选择的报告类型,记录应显示在晶体上或DGV中.
但是,看不到已处理的记录,即使Crystal或dgv仍然不可见...

以下文字已从评论中移出-LOSMAC [/EDIT]

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...

Text below was moved from comment - LOSMAC[/EDIT]

 Call DBMain() 'Connection
ComboBox1.Text = "KRW"

'main form 
frmdata03.Show() 
frmtxn01.Hide() 
frmdata04.Hide()
ReportMain.Hide() 

Call GR01(TextBox4.Text, TextBox5.Text, ComboBox1.Text, frmdata03.DataGridView1) ' Method
Close() ' to release this (2nd) form

'DGV to be flooded with records which is in main form
frmdata03.DataGridView1.Width = 752
frmdata03.DataGridView1.Height = 619
frmdata03.DataGridView1.Visible = True
frmdata03.Button1.Visible = True



这是方法RSP_GR01里面的代码是一个存储过程



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)
'ByVal findcurr 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

推荐答案

在您发布的代码中没有看到我将水晶报表的数据源设置为提取的数据的位置.全部通过设计师设置吗?如果是这样,请向我们说明您做了什么.另外,您声明datagridview和reportviewer设置为visiblity = false.但是我看不到将报表查看器的可见性设置回True的任何地方.要么这就是您缺少的重要代码,要么您没有发布相关代码.
No where in the code you posted do I see you setting up the crystal report''s datasource to the data you pull. Is it all setup via the designer? If so, please explain to us what you did. Also, you state that the datagridview and reportviewer are set to visiblity=false. But I don''t see any place where you are setting the report viewer''s visibility back to True. Either that is the vital bit of code you are missing, or you didn''t post the relevant code.


这篇关于以主要形式显示记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆