Public Class frmreports

    Private Sub studentList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        reports("SELECT s.`IDNO`, CONCAT ( `LNAME`, ' , ',`FNAME` , ' ',`MNAME`) as 'Name', `SEX`, `AGE`, `HOME_ADD`, `AY`, `YR`, `STATUS` " _
                & "FROM `tblstudent`  s,`schoolyr` sy WHERE  s.`IDNO`=sy.`IDNO` AND YR ='" & cboLevel.Text _
                & "' AND AY = '" & cbosy.Text & "'", "masterlist", CrystalReportViewer1)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        reports("SELECT Concat(`FNAME`,' ', `LNAME`,' ', `MNAME`) AS 'FULL NAME',`AY`, `YR`,`SEX`, `HOME_ADD` FROM `tblstudent` s, `schoolyr` sy WHERE  s.`IDNO`=sy.`IDNO`", "chart", CrystalReportViewer1)
    End Sub

    Private Sub btnstudecopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstudecopy.Click
        reports("SELECT CONCAT(  `FNAME` ,  ' ',  `LNAME` ,  ' ',  `MNAME` ) AS  'NAME',  `LEVEL` ,  `SECTION` , l.`AY` ,  `SUBJ_CODE`,`SUBJ_DESCRIPTION` " _
                & " FROM  `tblstudent` s,  `tblstudupdatelevel` l,  `grades` g,  `subject` sub" _
                & " WHERE s.`IDNO` = l.`IDNO` " _
                & " AND l.`IDNO` = g.`IDNO` " _
                & " AND g.`SUBJ_ID` = sub.`SUBJ_ID` AND s.`IDNO` ='" & txtsearchid.Text & "'", "studentscopy", CrystalReportViewer1)
    End Sub

    Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint

    End Sub

    Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load

    End Sub

    Private Sub frmreports_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        sql = "SELECT  `LEVEL` FROM `level`"
        fillCombo(sql, cboLevel, "LEVEL")

        sql = "SELECT  `ACADYR` FROM `ay`"
        fillCombo(sql, cbosy, "ACADYR")
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Me.Close()
    End Sub
End Class