我有水晶报告!在那我想打印水晶报告中的文本框的输入值,我的代码是,
Dim report As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim xs As String
xs = salfdte2.Text
Dim cmd1 As OleDbCommand = New OleDbCommand("SELECT * from product",con)
myDA = New OleDbDataAdapter(cmd1)
myDataSet = New DataSet()
myDA.Fill(myDataSet, "product")
report.Load(Application.StartupPath & "\saledtewserpt.rpt")
report.SetParameterValue("fdte", xs)
'the above line is my pproblem
report.SetDataSource(myDataSet.Tables("outwardp"))
saledtereport.CrystalReportViewer1.ReportSource = report
saledtereport.ShowDialog()
它运行良好但在运行时报告要求我输入fdte参数的参数值!我不想要这个提示!如何解决这个问题呢?在此先感谢开发人员。
答案 0 :(得分:0)
我认为您在设置ReportViewer
后需要在ReportViewer.ReportSource
上设置参数。
saledtereport.CrystalReportViewer1.ReportSource = report
saledtereport.ParameterFieldInfo.Item("fdte").CurrentValues.Add(xs)
另一方面,如果您只是尝试设置名为myTextBox
的文本框的值,则可能会执行类似
Dim textBox As CrystalDecisions.CrystalReports.Engine.TextObject
textBox = Report.ReportDefinition.ReportObjects.Item("myTextBox")
textBox.Text = ws