private void jButton16ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton16ActionPerformed int type = 1; // arbour valley = 2 if (type == 2) { Report_GL_welfare_type2 pgreenleaf = new Report_GL_welfare_type2(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } else { Date_Handler datehandler = new Date_Handler(); HashMap param = new HashMap(); // jProgressBar1.setValue(10); String[] DATE = datehandler.get_today_date().split("-"); String[] temp = datehandler.Reverse_months(DATE[0], DATE[1], 6).split("-"); System.out.println(temp[0] + temp[1]); param.put("month", DATE[0] + "-" + Integer.parseInt(DATE[1])); // param.put("to_date", Return_date2); param.put("USER", new UserAccountControl().get_current_user()); param.put("12month", temp[0] + temp[1]); // Date Return_date = datechooser.Return_date(yearfield, monthfield, dayfield); String location = dbm.checknReturnStringData("file_locations", "description", "Reports", "location"); String Slocation = dbm.checknReturnStringData("file_locations", "description", "ReportSave", "location"); generate.create("GL_welfare", Slocation, param, location, "welfareCross.jrxml"); progress.setValue(100); } } // GEN-LAST:event_jButton16ActionPerformed
/** @author Pramo */ public class Reports_GL extends javax.swing.JPanel { GL_report_generator report_gen = new GL_report_generator(); Date_Handler date_handler = new Date_Handler(); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); Report_gen generate = new Report_gen(); UserAccountControl user = new UserAccountControl(); /** Creates new form Reports_GL */ public Reports_GL() { defaults.put("nimbusOrange", defaults.get("nimbusBase")); UIManager.getLookAndFeelDefaults().put("nimbusOrange", (new Color(51, 153, 0))); initComponents(); progress.setStringPainted(true); if (Main_versioning.SoftwareVersion() == 2) { jButton17.setEnabled(true); jButton19.setEnabled(true); } if (Main_versioning.SoftwareVersion() == 1) { jButton17.setEnabled(false); jButton19.setEnabled(false); } } DatabaseManager dbm = DatabaseManager.getDbCon(); String saveloc = dbm.checknReturnStringData("file_locations", "description", "ReportSave", "location"); /** * This method is called from within the constructor to initialize the form. WARNING: Do NOT * modify this code. The content of this method is always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton21 = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jButton8 = new javax.swing.JButton(); jButton13 = new javax.swing.JButton(); jButton14 = new javax.swing.JButton(); jButton15 = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jButton9 = new javax.swing.JButton(); jButton10 = new javax.swing.JButton(); jButton11 = new javax.swing.JButton(); jButton12 = new javax.swing.JButton(); jButton16 = new javax.swing.JButton(); jButton17 = new javax.swing.JButton(); jButton18 = new javax.swing.JButton(); jButton19 = new javax.swing.JButton(); jButton20 = new javax.swing.JButton(); content = new javax.swing.JPanel(); progress = new javax.swing.JProgressBar(); setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(51, 153, 0), 3)); jPanel1.setBorder( javax.swing.BorderFactory.createTitledBorder( javax.swing.BorderFactory.createEtchedBorder(), "Basic Reports", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(102, 102, 102))); jButton1.setText("Suppliers"); jButton1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Rates"); jButton2.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("Categories(routes)"); jButton3.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton5.setText("Branches"); jButton5.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jButton4.setText("Banks"); jButton4.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jButton21.setText("Govt. Extra Pay"); jButton21.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton21ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addComponent( jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( jPanel1Layout .createSequentialGroup() .addComponent( jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(32, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addGroup( jPanel1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE)) .addComponent( jButton21, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel2.setBorder( javax.swing.BorderFactory.createTitledBorder( javax.swing.BorderFactory.createEtchedBorder(), "Final Reports", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(102, 102, 102))); jButton6.setText("Daily Transactions"); jButton6.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jButton7.setText("Weekly Advances"); jButton7.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jButton8.setText("Monthly Ledger"); jButton8.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton8ActionPerformed(evt); } }); jButton13.setText("Payment Lists"); jButton13.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton13ActionPerformed(evt); } }); jButton14.setText("Sup: Monthly Totals"); jButton14.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton14ActionPerformed(evt); } }); jButton15.setText("Pay Slip"); jButton15.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton15ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent( jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jButton14, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent( jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(28, Short.MAX_VALUE))); jPanel2Layout.setVerticalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent( jButton7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE) .addComponent( jButton6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jButton8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(5, 5, 5) .addGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent( jButton14, javax.swing.GroupLayout.DEFAULT_SIZE, 44, Short.MAX_VALUE) .addComponent( jButton15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jButton13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel3.setBorder( javax.swing.BorderFactory.createTitledBorder( javax.swing.BorderFactory.createEtchedBorder(), "Transactions Reports", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(102, 102, 102))); jButton9.setText("Transactions"); jButton9.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton9ActionPerformed(evt); } }); jButton10.setText("Cash Advances"); jButton10.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton10ActionPerformed(evt); } }); jButton11.setText("Other Advances"); jButton11.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton11ActionPerformed(evt); } }); jButton12.setText("Loans"); jButton12.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton12ActionPerformed(evt); } }); jButton16.setText("Welfare"); jButton16.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton16ActionPerformed(evt); } }); jButton17.setText("Transport Reports"); jButton17.setEnabled(false); jButton17.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton17ActionPerformed(evt); } }); jButton18.setText("Supplied List"); jButton18.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton18ActionPerformed(evt); } }); jButton19.setText("Supplier Welfare"); jButton19.setEnabled(false); jButton19.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton19ActionPerformed(evt); } }); jButton20.setText("Note Analysis"); jButton20.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton20ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent( jButton12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jButton9, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE) .addComponent( jButton18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent( jButton10, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE) .addComponent( jButton16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jButton19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent( jButton11, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE) .addComponent( jButton17, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE) .addComponent( jButton20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(31, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jButton20, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent( jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jButton19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup( jPanel3Layout .createSequentialGroup() .addGroup( jPanel3Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jButton18, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jButton17, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); javax.swing.GroupLayout contentLayout = new javax.swing.GroupLayout(content); content.setLayout(contentLayout); contentLayout.setHorizontalGroup( contentLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 418, Short.MAX_VALUE)); contentLayout.setVerticalGroup( contentLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 450, Short.MAX_VALUE)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(20, 20, 20) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent( jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup( layout .createSequentialGroup() .addGap(10, 10, 10) .addComponent( progress, javax.swing.GroupLayout.PREFERRED_SIZE, 437, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( content, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( content, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( layout .createSequentialGroup() .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(1, 1, 1) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( progress, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))); } // </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton1ActionPerformed Report_GL_suppliers pgreenleaf = new Report_GL_suppliers(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton1ActionPerformed private void jButton2ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton2ActionPerformed HashMap param = new HashMap(); param.put("USER", user.get_current_user()); Thread b = new Thread(new call_thread("GL_Rate", saveloc, param, "Rate_details", 1)); b.start(); } // GEN-LAST:event_jButton2ActionPerformed private void jButton3ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton3ActionPerformed HashMap param = new HashMap(); param.put("USER", user.get_current_user()); Thread b = new Thread(new call_thread("GL_CAT", saveloc, param, "Gl_category", 1)); b.start(); } // GEN-LAST:event_jButton3ActionPerformed private void jButton4ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton4ActionPerformed HashMap param = new HashMap(); param.put("USER", user.get_current_user()); Thread b = new Thread(new call_thread("GL_CAT", saveloc, param, "Bank_details", 1)); b.start(); } // GEN-LAST:event_jButton4ActionPerformed private void jButton5ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton5ActionPerformed HashMap param = new HashMap(); param.put("USER", user.get_current_user()); Thread b = new Thread(new call_thread("GL_CAT", saveloc, param, "Branch", 1)); b.start(); } // GEN-LAST:event_jButton5ActionPerformed private void jButton6ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton6ActionPerformed /* Thread a = new Thread(new Background(35)); Thread t1 = new Thread(new ReportThread()); HashMap param = new HashMap(); param.put("USER", user.get_current_user()); param.put("Month", date_handler.Return_month_full(3)+" 2014"); Thread b = new Thread(new call_thread("Daily_tansactions_", saveloc, param,"Daily_transactions", 10)); // b.start(); t1.start(); a.start(); */ Report_GL_daily_transactions pgreenleaf = new Report_GL_daily_transactions(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton6ActionPerformed private void jButton7ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton7ActionPerformed Report_GL_weekly_advances pgreenleaf = new Report_GL_weekly_advances(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton7ActionPerformed private void jButton8ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton8ActionPerformed try { if ("1".equals(dbm.checknReturnData("file_locations", "id", "10", "location"))) { Report_GL_monthly_ledger_govt_extra_pay pgreenleaf = new Report_GL_monthly_ledger_govt_extra_pay(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } else { Report_GL_monthly_ledger pgreenleaf = new Report_GL_monthly_ledger(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } } catch (Exception e) { Report_GL_monthly_ledger pgreenleaf = new Report_GL_monthly_ledger(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } } // GEN-LAST:event_jButton8ActionPerformed private void jButton9ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton9ActionPerformed Report_GL_trans pgreenleaf = new Report_GL_trans(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton9ActionPerformed private void jButton10ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton10ActionPerformed Report_GL_cadvance pgreenleaf = new Report_GL_cadvance(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton10ActionPerformed private void jButton11ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton11ActionPerformed Report_GL_otheradd pgreenleaf = new Report_GL_otheradd(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton11ActionPerformed private void jButton12ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton12ActionPerformed Report_GL_loans pgreenleaf = new Report_GL_loans(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton12ActionPerformed private void jButton13ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton13ActionPerformed try { if ("1".equals(dbm.checknReturnData("file_locations", "id", "10", "location"))) { Report_GL_Payments_Govt_Extra_Pay pgreenleaf = new Report_GL_Payments_Govt_Extra_Pay(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } else { Report_GL_Payments pgreenleaf = new Report_GL_Payments(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } } catch (Exception e) { Report_GL_Payments pgreenleaf = new Report_GL_Payments(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } } // GEN-LAST:event_jButton13ActionPerformed private void jButton14ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton14ActionPerformed Report_GL_monthly_totals pgreenleaf = new Report_GL_monthly_totals(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton14ActionPerformed private void jButton15ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton15ActionPerformed try { if ("1".equals(dbm.checknReturnData("file_locations", "id", "10", "location"))) { Report_GL_PaySlip_Govt_Extra_Pay pgreenleaf = new Report_GL_PaySlip_Govt_Extra_Pay(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } else { Report_GL_PaySlip pgreenleaf = new Report_GL_PaySlip(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } } catch (Exception e) { Report_GL_PaySlip pgreenleaf = new Report_GL_PaySlip(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } } // GEN-LAST:event_jButton15ActionPerformed private void jButton16ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton16ActionPerformed int type = 1; // arbour valley = 2 if (type == 2) { Report_GL_welfare_type2 pgreenleaf = new Report_GL_welfare_type2(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } else { Date_Handler datehandler = new Date_Handler(); HashMap param = new HashMap(); // jProgressBar1.setValue(10); String[] DATE = datehandler.get_today_date().split("-"); String[] temp = datehandler.Reverse_months(DATE[0], DATE[1], 6).split("-"); System.out.println(temp[0] + temp[1]); param.put("month", DATE[0] + "-" + Integer.parseInt(DATE[1])); // param.put("to_date", Return_date2); param.put("USER", new UserAccountControl().get_current_user()); param.put("12month", temp[0] + temp[1]); // Date Return_date = datechooser.Return_date(yearfield, monthfield, dayfield); String location = dbm.checknReturnStringData("file_locations", "description", "Reports", "location"); String Slocation = dbm.checknReturnStringData("file_locations", "description", "ReportSave", "location"); generate.create("GL_welfare", Slocation, param, location, "welfareCross.jrxml"); progress.setValue(100); } } // GEN-LAST:event_jButton16ActionPerformed private void jButton17ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton17ActionPerformed Report_GL_Transport pgreenleaf = new Report_GL_Transport(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton17ActionPerformed private void jButton18ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton18ActionPerformed Report_GL_Supplied_Supplier_List pgreenleaf = new Report_GL_Supplied_Supplier_List(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton18ActionPerformed private void jButton19ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton19ActionPerformed Report_GL_Supplier_Welfare_Arbour pgreenleaf = new Report_GL_Supplier_Welfare_Arbour(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton19ActionPerformed private void jButton20ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton20ActionPerformed Report_GL_Note_Analysis pgreenleaf = new Report_GL_Note_Analysis(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton20ActionPerformed private void jButton21ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton21ActionPerformed Report_GL_PaySlip_Govt_Extra_Pay pgreenleaf = new Report_GL_PaySlip_Govt_Extra_Pay(); content.removeAll(); pgreenleaf.setSize(content.getSize()); content.add(pgreenleaf); validate(); repaint(); pgreenleaf.focus(); } // GEN-LAST:event_jButton21ActionPerformed public class Background implements Runnable { int delay; public Background(int Delay) { delay = Delay; } @Override public void run() { progress.setVisible(true); int a = (int) (Math.random() * 500); for (int i = 0; i <= 3000 + a; i++) { progress.setValue(100 * i / 4000); progress.repaint(); try { Thread.sleep(delay); } catch (InterruptedException ex) { Logger.getLogger(Reports_GL.class.getName()).log(Level.SEVERE, null, ex); } } } } public class call_thread implements Runnable { private String Filename; private String Save; private HashMap Param; private String Reportname; private int Delay; public call_thread(String filename, String save, HashMap param, String reportname, int delay) { Filename = filename; Reportname = reportname; Save = save; Param = param; Delay = delay; } @Override public void run() { Thread a = new Thread(new Background(Delay)); a.start(); // param.put("USER", user.get_current_user()); String location = dbm.checknReturnStringData("file_locations", "description", "Reports", "location"); generate.create(Filename, Save, Param, location, Reportname + ".jrxml"); a.stop(); progress.setValue(100); } } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.ButtonGroup buttonGroup1; private javax.swing.JPanel content; private javax.swing.JButton jButton1; private javax.swing.JButton jButton10; private javax.swing.JButton jButton11; private javax.swing.JButton jButton12; private javax.swing.JButton jButton13; private javax.swing.JButton jButton14; private javax.swing.JButton jButton15; private javax.swing.JButton jButton16; private javax.swing.JButton jButton17; private javax.swing.JButton jButton18; private javax.swing.JButton jButton19; private javax.swing.JButton jButton2; private javax.swing.JButton jButton20; private javax.swing.JButton jButton21; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JButton jButton8; private javax.swing.JButton jButton9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; public static javax.swing.JProgressBar progress; // End of variables declaration//GEN-END:variables }