Hi Ronaldo,
I think you´ d have to look at having the grid auto generate columns, and fetch your data with an sql widget making use of the pivot operator and the for json auto clause.
Both are sql constructs, not outsystems. Pivot is harder to learn, but can be googled.
Dorine