Trang chủ » Diễn Đàn » Lập trình và Phát triển Web » Business Intelligence and Reporting Tools » su dung crytal report 8.5
Chủ đề đã bị khóa, bạn không thể xóa, sửa hay trả lời trong chủ đề này!
|
|
|---|
|
0
xin giup minh moi.doan code nay sai o dau ma sao tao report ko ra nhi!!
Private Sub Form_Load() On Error Resume Next Dim mysql As String Screen.MousePointer = vbHourglass Report.DiscardSavedData Report.PaperOrientation = crPortrait Dim conn3 As ADODB.Connection Set conn3 = New ADODB.Connection conn3.CursorLocation = adUseClient conn3.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.path & "\DATA\QuanLyDiem.mdb;Persist Security Info=False" ' Open the connection Set rs = New ADODB.Recordset If DANHSACHSINHVIEN.Text1.Text = "" Then mysql = "select * from SinhVien" Else mysql = "select * from SinhVien where SinhVien.maLop = " & DANHSACHSINHVIEN.Text1.Text End If rs.Open mysql, conn3, adOpenKeyset, adLockReadOnly Report.Database.SetDataSource rs, , 1 Report.PaperSize = crPaperA4 CRViewer1.ReportSource = Report CRViewer1.DisplayTabs = False CRViewer1.ViewReport CRViewer1.Zoom 1 Printer.Orientation = 1 Screen.MousePointer = vbNormal End Sub |
|
|
|
0
bạn phải viết là
mysql = "select * from SinhVien where SinhVien.maLop = '" & DANHSACHSINHVIEN.Text1.Text+"'" (Nếu mã lớp của bạn là Nvarchar, Nchar hoặc Varchar, Char) |
