Create grid from 2-dimension array as datasource

Hello everyone,
I need to create a report with the grid. This grid has dynamically defined number of rows and columns. To do this I created in my datasource 2-dim array, e.g. like this
123
456.
I should show this array like I mentioned above in my report (two rows and three columns).
Could anybody help me to understand, how I can do it?

Hi Igor - welcome to the forum :slight_smile:!

Can you specify which kind of data source you are using and how “dynamic” this needs to be? Does the number of columns change all the time? What would the target layout look like?

Hi Jochen, thank you.
image
I need grid like this. I can convert all datatype to string, so my 2-dim array has string data type.
Yes, the number of col and rows can be changed a lot.
Layout is the same on the pic.

Sounds like you could make use of the object model (DOM) here. It allows to dynamically create columns on the fly. There are plenty of samples around, here is the starting point for the documentation for .NET if that is what you are using.

A minimal sample is here.

Thank you. I will come back when I read documentation that you provided.

1 Like

Sure. The full sample is also on GitHub:

1 Like

Hi Jochen.
This solution works for me. I need to do some changes, but I created grid based on 2-dim array. Thank you! It was good solution.

1 Like

© combit GmbH