Solved

using list view

Posted on 2014-02-09
24
421 Views
Last Modified: 2014-02-14
hi
i want to design one form previwing data such like this

1st list : will contain some fields of one table
item_no , some data ( each item one raw )
2nd list :
item_no , trans_type , trans_amount  ( many raws for each item )
once click any raw of 1st list  , it will auto requery the  data of that item in the 2nd list view
then , if user select one type ( by click its raw from the 2nd list ) to auto requesry the historical data in the 3rd list , like this
item_no , trans_date , some other info
the questions is :
1- any way to contain multi column for list view ?
2-how to requery the data from one list to another ?
thanx
0
Comment
Question by:NiceMan331
  • 12
  • 12
24 Comments
 
LVL 22

Accepted Solution

by:
Helena Marková earned 500 total points
ID: 39846568
1. There is no way for using a multi column for list view, but you can use something like this:
column_1||' '||column_2||' '||...||' '||column_n  for List Item (this is text label)
item_no for List Item value

2. You have to use When-List-Changed trigger and Populate_List built-in. When 1st list is changed then 2nd list is populated by using Populate_List with value 1st.item_no passed there.

I hope this will be a little help for you.
0
 

Author Comment

by:NiceMan331
ID: 39846571
ok
i used like this

 ADD_LIST_ELEMENT('MENU_SALES',1,vk.mi_shortname|| '- ' ||VK.u_p|| '- ' ||vk.qty|| '- ' ||vk.g_amt,vk.item);

but the problem here is :
vk.mi_shortname  is defined as 20 char size , the number after to it being not aligned
how to aligne the numbers to be in same level
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39846581
You can use RPAD function.
 ADD_LIST_ELEMENT('MENU_SALES',1,RPAD(vk.mi_shortname,20,' ')|| '- ' ||VK.u_p|| '- ' ||vk.qty|| '- ' ||vk.g_amt,vk.item);
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:NiceMan331
ID: 39846592
it is better than before , but not yet fully aligned
i used
select max(length(mi_shortname)) from sale_item;
it return 15
then i adjust the code to be 15 , it become more bad
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39846614
You can try this:
ADD_LIST_ELEMENT('MENU_SALES',1,RPAD(RTRIM(vk.mi_shortname),20,' ')|| '- ' ||VK.u_p|| '- ' ||vk.qty|| '- ' ||vk.g_amt,vk.item);
0
 

Author Comment

by:NiceMan331
ID: 39846645
still it didn't make enough align
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39846650
What is the length of column vk.mi_shortname ? 20 ?
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39846651
This works:
select rpad(rtrim('Hela'),20,'*') from dual;
Hela****************
select rpad(rtrim('Hela2'),20,'*') from dual;
Hela2***************
0
 

Author Comment

by:NiceMan331
ID: 39846873
yes this works in seperate sql
but still in the form not
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39846896
If you use this, is it OK ?
ADD_LIST_ELEMENT('MENU_SALES',1,RPAD(RTRIM(vk.mi_shortname),20,' '));
0
 

Author Comment

by:NiceMan331
ID: 39847862
it is ok because one column only , it is aligned left well , but what if add another field ? it again not aligned right to the 1st field
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39849342
Have you try something like this, haven't you ?
ADD_LIST_ELEMENT('MENU_SALES',1,
RPAD(RTRIM(vk.mi_shortname),20,' ')|| '- ' ||
RPAD(RTRIM(VK.u_p),xx,' ')|| '- ' ||  -- xx is length of VK.u_p column
RPAD(RTRIM(vk.qty),yy,' ')|| '- ' ||  -- yy is length of vk.qty column
RPAD(RTRIM(vk.g_amt),zz,' ')  -- zz is length of vk.g_amt column
,vk.item);

But because it is like one column it will never be aligned like 4 columns would be.
0
 

Author Comment

by:NiceMan331
ID: 39849755
yes , i adjust it , but still no
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39849781
Can you put here an output ?
0
 

Author Comment

by:NiceMan331
ID: 39849802
here is an image for the output
also , how can i add column name as a header ?
menu.JPG
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39849820
An output is OK, it wouldn't be better (there is only 1 column not 4 columns).
You can add Text as a header (put it above the list item).
0
 

Author Comment

by:NiceMan331
ID: 39849840
1- what do you mean by :   (there is only 1 column not 4 columns) ?
2-here also we will fail in aligning issue , because the header should align the details
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39849860
It means that a list item is not a block - it is only an item: we see a list label ("1 column") - here it is
RPAD(RTRIM(vk.mi_shortname),20,' ')|| '- ' ||
RPAD(RTRIM(VK.u_p),xx,' ')|| '- ' ||  -- xx is length of VK.u_p column
RPAD(RTRIM(vk.qty),yy,' ')|| '- ' ||  -- yy is length of vk.qty column
RPAD(RTRIM(vk.g_amt),zz,' ')  -- zz is length of vk.g_amt column

There also cannot be a header there.
0
 

Author Comment

by:NiceMan331
ID: 39849888
so , this is the best only ? if so , i may think to use non database subforms instead
because align is very important for me
could you guide me on what is the code to fill in the form from a cursor ?
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39849958
I have thought that VK is a table. You can create a block with insert, update and delete property = FALSE.
If you want to use a cursor, then you can loop through the cursor, use next_record built-in for creating record in a block and fill the block columns with cursor values.
It can be something like this:
Go_Block('block1');
first_record;
FOR it IN (SELECT col1,col2,col3 FROM table1) LOOP
      :block1.column1:=it.col1;
      :block1.column2:=it.col2;
      :block1.column3:=it.col3;
      :block1.column4:=it.col4;
     exit when (:System.Last_Record = 'TRUE');
     next_record;
END LOOP;
0
 

Author Comment

by:NiceMan331
ID: 39849983
ok
i will test it ,
thank you very much
0
 

Author Comment

by:NiceMan331
ID: 39854064
sorry henka for delay
i not yet test the last code
i still have alot of work
so , may i accept your question now , and if i have further explanation i open new one ?
i don't like to delay closing the question while you did your best with me
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39858228
I think that you can do it :)
0
 

Author Comment

by:NiceMan331
ID: 39858989
ok
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle SQL 6 73
database upgrade 8 111
Oracle sql query 7 74
Oracle Forms 10g: How-To Prevent a Commit of 1 Record in Master-Detail block. 3 52
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

860 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