Home » Developer & Programmer » Forms » How to display rows
How to display rows [message #260971] Tue, 21 August 2007 06:59 Go to next message
Catty
Messages: 64
Registered: April 2006
Location: Poland
Member
Hello everyone
I have made form in Forms 6.0. It has two blocks of data. Each of them is based on database table. One block B1 has elements:
Inventory number
Group

and the second block B2 has elements:
Group
Number
I display 12 rows of each block. I've made a relation between those two blocks: by the group. Block B1 is the master block.
First block (B1)display all rows, but in the second block B2 is display only one corresponding field. Rest 11 are empty.
Can anyone tell me how to synchronize those two blocks and display all corresponding rows?
Greetings
Re: How to display rows [message #261104 is a reply to message #260971] Tue, 21 August 2007 19:06 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Are you expecting multiple rows in block 'B2' for each record in block 'B1'?

David
Re: How to display rows [message #261159 is a reply to message #261104] Wed, 22 August 2007 01:15 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, if there is a master-detail relationship between those two blocks, master block will show all records (unless you restrict them by a query criteria), while detail block displays records which are "children" of the current master record.

If you want to display all master records and all detail records at the same time, remove master-detail relationship. But I guess that's not what you really want.
Re: How to display rows [message #261594 is a reply to message #260971] Thu, 23 August 2007 01:56 Go to previous messageGo to next message
Catty
Messages: 64
Registered: April 2006
Location: Poland
Member
Hello
Those data come from two different tables. What I really want is to get data from one table (let's say master table) and by the key get data from that second table (slave table). The number of data from first table is 12 and are shown all, but corresponding data from second table (there is 12 row) are display only one.
Should I write some trigger that fetch those data from second table? When I delete relationship data from second table ar invisible.
Greetings
Re: How to display rows [message #261646 is a reply to message #261594] Thu, 23 August 2007 03:41 Go to previous messageGo to next message
sanka_yanka
Messages: 184
Registered: October 2005
Location: Kolkata
Senior Member

Could you please post the table structure and some data.
Then it would be easier for us to give you a fast solution.

Cheers
Sanka
Re: How to display rows [message #261666 is a reply to message #261594] Thu, 23 August 2007 05:16 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'd say that David already gave the answer ... are you sure that there is more than only one detail record for that particular master record you mentioned?
Re: How to display rows [message #261883 is a reply to message #261594] Thu, 23 August 2007 23:18 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
We know they come from different tables because you have told us that already Why are you people incapable of answering questions instead of saying the same stuff over again and again? I asked
Quote:
Are you expecting multiple rows in block 'B2' for each record in block 'B1'?

Answer this question or I will lock this thread.

David
Re: How to display rows [message #261955 is a reply to message #260971] Fri, 24 August 2007 02:53 Go to previous messageGo to next message
Catty
Messages: 64
Registered: April 2006
Location: Poland
Member
Sorry!
Answer:
For each block in B1 I expect only one row in block B2.
Greetings

Re: How to display rows [message #261960 is a reply to message #261955] Fri, 24 August 2007 03:03 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
/forum/fa/1600/0/ So where's the problem? Every master record has only one detail record, and you wonder where is the rest of them? The rest doesn't exist!
Re: How to display rows [message #261992 is a reply to message #260971] Fri, 24 August 2007 05:27 Go to previous messageGo to next message
Catty
Messages: 64
Registered: April 2006
Location: Poland
Member
There is problem.
My form looks like this:

First blok B1 (master table)    Second Block B2(data extract
                                 by the key)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    row 1                         corresponding value fro row1
    row 2                         null(should be value for row2)
    row 3                         null(should be value for row3)
    row 4                         null(should be value for row4)
    row 5                         null(should be value for row5)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Second block of data doesn't show all selected data. I don't know why,although it's source is table, just like for the first block B1.
Greetings
Re: How to display rows [message #261995 is a reply to message #261992] Fri, 24 August 2007 05:47 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
But this is NOT how master-detail relationship works!!!

If you, however, want to do that, then remove master-detail relationship between those two blocks and use appropriate ORDER BY in both blocks.

This will be a complete mess, sooner or later. I wouldn't use it, no way.
Re: How to display rows [message #262026 is a reply to message #261995] Fri, 24 August 2007 06:33 Go to previous messageGo to next message
Catty
Messages: 64
Registered: April 2006
Location: Poland
Member
I have ORDER BY. But if I delete relationship, even first row in block B2 disappears.
Re: How to display rows [message #262039 is a reply to message #262026] Fri, 24 August 2007 06:46 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Ummm ... no. It doesn't disappear, but it never showed up! OK, the result is the same, but the principle isn't.

If you want to display records in both groups (WITHOUT master-detail relationship!), do (in the WHEN-NEW-FORM-INSTANCE trigger, for example)
GO_BLOCK('master');
EXECUTE_QUERY;

GO_BLOCK('detail');
EXECUTE_QUERY;
Now you'll have records in both blocks.
Previous Topic: Can win_api_dialouge be used to open file dialuge box in web using forms 10g?
Next Topic: The data don't be keep!
Goto Forum:
  


Current Time: Fri Sep 27 04:25:07 CDT 2024