如何在 Visual Basic 2005 中的水晶报表中将文本框值作为参数传递 [英] How to pass textbox values as parameter in crystal report in Visual Basic 2005

查看:15
本文介绍了如何在 Visual Basic 2005 中的水晶报表中将文本框值作为参数传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Form1 有一个 button1 和一个 texbox1,当我点击 button1 时,form2 将加载水晶报告并显示我放在 textbox1 上的数据.已经创建了Parameters Field crTextBox 并放入了crystalreport.如何将 textbox1.text 值传递给 crTextBox.

Form1 has a button1 and a texbox1, when I click button1, form2 will load with crystal report on it and display data that I put on textbox1. Already created Parameters Field crTextBox and put into crystalreport. How can I pass textbox1.text value to crTextBox.

推荐答案

在Form2里面添加如下代码

Add the following code inside Form2

Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Dim Report1 As New CrystalReport1

    Report1.SetParameterValue("crTextBox", Form1.TextBox1.Text)
    CrystalReportViewer1.ReportSource = Report1
End Sub

这篇关于如何在 Visual Basic 2005 中的水晶报表中将文本框值作为参数传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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