move from one row to the other in a grid

tanu

Active Member
Hi,
I am doing a customized app in our company, and I got a difficulties when I want to fetch a record from a table to the grid, I describe the situation below :

The record in a table :

FieldName0....FieldName1.....FieldName2...... FieldName3
123................Item #1............Size1................30
123................Item #1............Size2................25
123................Item #2............Size1................40
123................Item #3............Size3................30

While we want to display those recrods on the grid like this :

Item Name............Size1......Size2.......Size3
Item #1..................30..........25
Item #2..................40
Item #3..............................................30

The header title of Size is determined by the content of FieldName2

I have tried to do a select then in a while loop do a fetch next, but it seems it just update the row #1 on the grid, I have add
the insert row, with the same result, the row was added but the data just update the grid row #1, so I think I have to know how to move the pointer from one row to the other so after doing an insert row I can do a pointer move to that row then do an update, but the problem is I couldn't find any info how to move from one row to the other, anybody can help me on this ? or maybe there is a better approach ?
The command to move from row to other is also needed when I try to delete (hide) one column because I want to do this :
When the column is deleted (hide) I want all data on that record are deleted (change to 0), I can do that when the content of the grid is just one row, but if more than one when the column is command to reappear the data on the the 1st record is 0 (as expected) but the 2nd and above is still contain the last value (it is not expected).

Thanks in advance for the answer.

Regards,

*** Tanu ***
OneWorld XE SP 18 on W2K
with Oracle 8.1.7 as the db server
 
Hello,

I was also facing the same problem. Using the System Function
GetGrid Row u can move the pointer.
GetGridRow(FC GRID,1)-This will retrieve Ist row.
GetGridRow(FC GRID,2)-2nd row like that.

u can use GetMaxGridRow() and store it in a variable. u can use
this variable instead of using1,2,3 etc.

Put this in a while loop.

GetMaxGridRow(FC GRID,variable)
variable=variable-1
While(GC linenumber < variable)
GetGridRow(FCGRID ,variable)
Table.INSERT
Variable=Variable-1
Endwhile

This is used to retrieve grid rows from Form and store into a
different table

Similarly u can try with FetchNext Function for this.


----- Original Message -----
From: "tanu" <[email protected]>
To: <[email protected]>
Sent: Wednesday, August 14, 2002 7:25 AM
Subject: move from one row to the other in a grid


I want to fetch a record from a table to the grid, I describe the situation
below :
seems it just update the row #1 on the grid, I have add
how to move the pointer from one row to the other so after doing an insert
row I can do a pointer move to that row then do an update, but the problem
is I couldn't find any info how to move from one row to the other, anybody
can help me on this ? or maybe there is a better approach ?
 
Tanu,
You may consider transposing your tble X to tble Y (and creating the necessary view over tble Y) just BEFORE calling the customized application (whose grid should display view Y).
FieldName0 would be your key.
Warm regards,
Adrian Chimirel
PS Sometimes we tend to do two (or more) things at a time, whereas our teacher says: use baby steps!
 
How about using "Insert Grid Buffer" and Using GB values instead of GCs

OW Hell
 
Thanks for the reply Adrian.

Actually this is one thing I avoided, considering that at the same time the application can be use by more than 1 user, so the data in the temporary table will be confusing.
 
I already done that too, but it looks like the insert command is not respect the if clause, its iteration add the row as many as the iteration.
 
Back
Top