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

    if (startRow > 0) {
      TableRowBlock tableRow = (TableRowBlock) tableBlock.getChildren().get(startRow - 1);
      for (int i = startColumn; i <= endColumn; i++) {
        String key = cellContentAsString((TableCellBlock) tableRow.getChildren().get(i));
        datasetBuilder.setColumnHeading(i - startColumn, key);
      }
    } else {
      for (int i = startColumn; i <= endColumn; i++) {
        datasetBuilder.setColumnHeading(i - startColumn, "C" + i);
      }
    }
  }