When you are getting dataKey, you are calling method cols
instead of columns
.
By the way, you shouldn't call it for each cell, it would be too slow. Get the column keys into an array before looping over the data cells and save them in a local variable.
Other than that, it looks good to me though I haven't done it in ages and might be forgetting something.
Suerte