public static GivingRecord fromSchemaVersion10Csv(String csv, String[] headers)
     throws ParseException {
   try {
     final String[] tokens = csv.split(",");
     int tokenIndex = 0;
     final String dateString = tokens[tokenIndex++].trim();
     final String lastName = tokens[tokenIndex++].trim();
     final String firstName = tokens[tokenIndex++].trim();
     final GivingRecord record = new GivingRecord(dateString, lastName, firstName, "", "");
     final String[] categories = Arrays.copyOfRange(headers, tokenIndex, headers.length - 1);
     final List<String> definedCategories = Settings.getInstance().getCategories();
     for (String category : categories) {
       if (definedCategories.contains(category)) {
         record.setAmountForCategory(category, Double.parseDouble(tokens[tokenIndex++]));
       }
     }
     return record;
   } catch (Exception e) {
     throw new ParseException(csv, 0);
   }
 }
  private static JRDataSource createDataSource(String lastName, String firstName) {
    final List<GivingRecord> records =
        RecordManager.getInstance().getRecordsForName(lastName, firstName);

    final List<String> columnList = new ArrayList<String>();
    columnList.add("date");
    columnList.add("fundType");
    columnList.add("checkNumber");
    final List<String> categories = Settings.getInstance().getCategories();
    columnList.addAll(categories);
    columnList.add("total");

    final String[] columns = new String[columnList.size()];
    columnList.toArray(columns);

    final DRDataSource dataSource = new DRDataSource(columns);

    for (GivingRecord record : records) {
      final List<Object> data = new ArrayList<Object>();
      data.add(record.getDateString());
      data.add(record.getFundType());
      if (record.getCheckNumber().isEmpty()) {
        data.add(null);
      } else {
        data.add(Short.parseShort(record.getCheckNumber()));
      }
      for (String category : categories) {
        final BigDecimal amount = new BigDecimal(record.getAmountForCategory(category));
        data.add(amount);
      }
      data.add(new BigDecimal(record.getTotal()));
      dataSource.add(data.toArray());
    }

    return dataSource;
  }