For documentation visit: https://dev.to/ron_clarijs/create-data-reports-using-javascript-function-15dc