我用的是VS.NET2003自带的水晶报表!
我想将查询结果用水晶报表显示出来!请问如何实现?
小弟才此谢过!
Imports System.Data.SqlClient
Module shared_Mod
Public con_print As new sqlconnection("server=yourserver;database=master;integrated security=true;")
Public str_print As String '用于窗体Userinformation打印单用户的登陆信息
end module
class usersInformation
inherits form
...
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
str_print = Trim(Me.TextBox1.Text)
Dim frm As New userinfromation_print_single
frm.ShowDialog()
End Sub
end class
class userinfromation_print_single
inherits form
...
Dim ds_print As New DataSet
Private Sub userinfromation_print_single_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim da2 As New SqlDataAdapter("use finalproducts select * from logintable where loginname='" & str_print & "'", con_print)
da2.Fill(ds_print, "logintable_print")
Dim c As New userinformation_single
c.SetDataSource(ds_print.Tables("logintable_print"))
CrystalReportViewer1.ReportSource = c
end sub
...
end class