Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 436
  • Last Modified:

using list view

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
NiceMan331
Asked:
NiceMan331
  • 12
  • 12
1 Solution
 
Helena Markováprogrammer-analystCommented:
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
 
NiceMan331Author Commented:
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
 
Helena Markováprogrammer-analystCommented:
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
NiceMan331Author Commented:
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
 
Helena Markováprogrammer-analystCommented:
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
 
NiceMan331Author Commented:
still it didn't make enough align
0
 
Helena Markováprogrammer-analystCommented:
What is the length of column vk.mi_shortname ? 20 ?
0
 
Helena Markováprogrammer-analystCommented:
This works:
select rpad(rtrim('Hela'),20,'*') from dual;
Hela****************
select rpad(rtrim('Hela2'),20,'*') from dual;
Hela2***************
0
 
NiceMan331Author Commented:
yes this works in seperate sql
but still in the form not
0
 
Helena Markováprogrammer-analystCommented:
If you use this, is it OK ?
ADD_LIST_ELEMENT('MENU_SALES',1,RPAD(RTRIM(vk.mi_shortname),20,' '));
0
 
NiceMan331Author Commented:
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
 
Helena Markováprogrammer-analystCommented:
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
 
NiceMan331Author Commented:
yes , i adjust it , but still no
0
 
Helena Markováprogrammer-analystCommented:
Can you put here an output ?
0
 
NiceMan331Author Commented:
here is an image for the output
also , how can i add column name as a header ?
menu.JPG
0
 
Helena Markováprogrammer-analystCommented:
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
 
NiceMan331Author Commented:
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
 
Helena Markováprogrammer-analystCommented:
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
 
NiceMan331Author Commented:
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
 
Helena Markováprogrammer-analystCommented:
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
 
NiceMan331Author Commented:
ok
i will test it ,
thank you very much
0
 
NiceMan331Author Commented:
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
 
Helena Markováprogrammer-analystCommented:
I think that you can do it :)
0
 
NiceMan331Author Commented:
ok
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 12
  • 12
Tackle projects and never again get stuck behind a technical roadblock.
Join Now