Solved

using list view

Posted on 2014-02-09
24
409 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
Comment Utility
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
Comment Utility
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á
Comment Utility
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
 

Author Comment

by:NiceMan331
Comment Utility
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á
Comment Utility
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
Comment Utility
still it didn't make enough align
0
 
LVL 22

Expert Comment

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

Expert Comment

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

Author Comment

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

Expert Comment

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

Author Comment

by:NiceMan331
Comment Utility
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á
Comment Utility
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
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
Comment Utility
yes , i adjust it , but still no
0
 
LVL 22

Expert Comment

by:Helena Marková
Comment Utility
Can you put here an output ?
0
 

Author Comment

by:NiceMan331
Comment Utility
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á
Comment Utility
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
Comment Utility
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á
Comment Utility
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
Comment Utility
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á
Comment Utility
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
Comment Utility
ok
i will test it ,
thank you very much
0
 

Author Comment

by:NiceMan331
Comment Utility
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á
Comment Utility
I think that you can do it :)
0
 

Author Comment

by:NiceMan331
Comment Utility
ok
0

Featured Post

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.

Join & Write a Comment

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now