[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to totalize a field in a multi-line block from a multi line sub block in Oracle Forms.

Posted on 2008-11-12
6
Medium Priority
?
828 Views
Last Modified: 2013-12-07
Hi.
I have two multiline blocks , A and B. Typicall master and detai relation. B is the detail block from A.
I want to put a sum item in A block, getting the total ammount from her childs in the A block.
but i get the error: the item must be in the same block or the block must be only 1 record.
If i do the master block  only 1 reg not problem, but i need this block multi reg too.
how can i put a sum item from detail block in the master block (multi line too)?
0
Comment
Question by:Colorker
  • 3
  • 3
6 Comments
 
LVL 7

Expert Comment

by:Dr_Billy
ID: 22940867
What you need to do is create a control block with a single record and only one item which is going to hold the summarized data from the detail block , you can display that item on the screen with the Master block , there is no harm in that.

set the summary item in that block to point to the item that you want find it's summation in the detail block , that will resolve your problem.
0
 

Author Comment

by:Colorker
ID: 22941844
humm...
I have created another block (ej: A2) with the sum item with only a reg. it's ok, it displays the sum from block B regs, but i still can't display this summarized result in the multi-reg master block (A). I can't copy the value to the real item in A block, I can't set "coy value from..." or syncronize. If i set this item like sum of the fake item , i get the same error.
Sorry for my English....
0
 
LVL 7

Expert Comment

by:Dr_Billy
ID: 22941964
Can you please post snapshots of the blocks , and set the item that you want to summarize so I can get a clear picture of what you want to do , am a bit confused.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Colorker
ID: 22942217
Here is it.
sample.JPG
0
 
LVL 7

Accepted Solution

by:
Dr_Billy earned 375 total points
ID: 22951120
Waht would solve your problem is to create a non-database item on the master block, in your post-Query trigger on the block level , do the following

Declare
  V_Sum Number  ;
Begin
  Begin
    Select Nvl(Sum(Details_Column_name),0)
       into  V_Sum
      from  your_Details_Table
   Where  Your_Deails_Table.Master_Table_FK = :Master_Block.Primary_Key ;

   Exception
     When others then
        V_Sum := 0 ;
  End;
  :Master_Block.tot.lin := V_Sum  ;
End;  
0
 

Author Closing Comment

by:Colorker
ID: 31515891
Ok, I will do it in that way. It wanted to avoid that manual calculations, but it seems it is the only way. Thanks for all.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Via a live example, show how to take different types of Oracle backups using RMAN.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question