fanboime12
fanboime12

Reputation: 21

How to group rows vertically in PowerBuilder?

I have this sample rows of plate nos with bay nos:

Plate no | Bay no
------------------
AAA111   |   1
AAA222   |   1
AAA333   |   2
BBB111   |   3
BBB222   |   3
CCC111   |   1

Is there a way to make it look like this in a datawindow in powerbuilder?

  1    |   2    |   3
------------------------
AAA111 | AAA333 | BBB111
AAA222            BBB222
CCC111

Upvotes: 1

Views: 836

Answers (2)

Eduardo G.
Eduardo G.

Reputation: 441

If you use Oracle to obtain the data you can use the Pivot and Unpivot function to perform what you are looking for. Here is an example of how to do it:

http://www.oracle.com/technetwork/es/articles/sql/caracteristicas-database11g-2108415-esa.html

Upvotes: 1

Rich Bianco
Rich Bianco

Reputation: 4174

There isn't an simple answer, especially if you need cells to be update-able.

Variable Column Count Strategy

If the number of columns across the top is unknown at development time than you might get by with a "Crosstab" style datawindow but it would be a display only. If you need updates you'll need to do manual data manipulations & updates as each cell would probably represent one row.

Fixed Column Count Strategy

If the number of columns is known (fixed) you could flatten the data at the database and use a standard tabular (or grid) datawindow control but you'll still need to get creative if updates are needed.

Upvotes: 1

Related Questions