public Object getValueAt(int row, int column) {
            if (row >= capitalGains.size())
                throw new IndexOutOfBoundsException("Report row "+row+" is not valid");

            CapitalGainRecord g = capitalGains.get(row);
            Object value = null;

            switch (column) {
                case 0:                         // Security
                    value = g.getSecurity().getName();
                    break;

                case 1:                         // Date bought
                    value = Main.getDateString(g.getPurchaseDate());
                    break;

                case 2:                         // Date sold
                    value = Main.getDateString(g.getSellDate());
                    break;

                case 3:                         // Number of shares
                    value = String.format("%,.4f", g.getShares());
                    break;

                case 4:                         // Cost
                    value = String.format("%,.2f", g.getCostBasis());
                    break;

                case 5:                         // Amount
                    value = String.format("%,.2f", g.getSellAmount());
                    break;

                case 6:                         // Gain/Loss
                    double gain = g.getSellAmount()-g.getCostBasis();
                    if (Math.abs(gain) < 0.005)
                        gain = 0.0;
                    
                    value = String.format("%,.2f", gain);
                    break;

                default:
                    throw new IndexOutOfBoundsException("Report column "+column+" is not valid");
            }

            return value;
        }