Solved

using list view

Posted on 2014-02-09
24
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL query for highest sequence 4 75
update using pipeline function 3 46
how to tune the query 17 82
Oracle - BLOB Extract Line 2 15
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

732 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