/**
   * @param tableBlock The table block to parse.
   * @param startRow The first row to include.
   * @param endRow The last row to include.
   * @param startColumn The first column to include.
   * @param datasetBuilder The dataset builder.
   * @throws MacroExecutionException if there are any errors in the table.
   */
  private void getRowKeys(
      TableBlock tableBlock,
      int startRow,
      int endRow,
      int startColumn,
      TableDatasetBuilder datasetBuilder)
      throws MacroExecutionException {

    datasetBuilder.setNumberOfRows(endRow - startRow + 1);

    if (startColumn > 0) {
      Set<String> rowKeySet = new HashSet<String>();
      for (int i = startRow; i <= endRow; i++) {
        TableRowBlock tableRow = (TableRowBlock) tableBlock.getChildren().get(i);
        String key =
            cellContentAsString((TableCellBlock) tableRow.getChildren().get(startColumn - 1));
        datasetBuilder.setRowHeading(i - startRow, key);
      }
    } else {
      for (int i = startRow; i <= endRow; i++) {
        datasetBuilder.setRowHeading(i - startRow, "R" + i);
      }
    }
  }