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

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)?
ColorkerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dr_BillyCommented:
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
ColorkerAuthor Commented:
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
Dr_BillyCommented:
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

ColorkerAuthor Commented:
Here is it.
sample.JPG
0
Dr_BillyCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ColorkerAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.