private void btnInputReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInputReportActionPerformed
        // TODO add your handling code here:
        if (btnClearReport.isEnabled()) return;
        Test_Controller TC = new Test_Controller("localhost", DBName, DBAccount, DBPwd);
        int tid = SelectedTest.TestID;
        if (ThisUser.UserType == User.U_Types.LABTECH)
        {
            tbxError.setText("Permission denied.");
            return;
        }
        if ((tid<=0)||(SelectedTest.Status.equals("NONE")))
        {
            tbxError.setText("No test to update.");
            return;
        }
        if (SelectedTest.Status.equals("ORDERED"))
        {
            tbxError.setText("This test is not finished.");
            return;
        }
        if (!SelectedTest.Status.equals("FINISHED"))
        {
            String msg = "The test may already have a report. \r\nDo you wish to continue?";
            int x = JOptionPane.showConfirmDialog(this, msg, "Do you wish to continue?",JOptionPane.YES_NO_OPTION);
            if (x!=0)
                return;
        }
        String tr = tbxReport.getText().replace("'","\\'");
        if (tr.trim().equals(""))
            tr = "(empty)";
        boolean flag = false;
        flag = TC.ReportTest(tid, tr, ThisUser.UserID);
        if (flag)
        {
            ArrayList temp = TC.SearchTest(tid, "Test");
            if (temp.size()<=0)
            {
                tbxError.setText(TC.err);
                RenderRR(new Test());
                return;
            }
            Test t = (Test)temp.get(0);
            RenderRR(t);
            SearchTests(0, String.valueOf(tid));
            tbxError.setText("Test reported.");
        }
        else
            tbxError.setText(TC.err);
    }