NiceMan331
asked on
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use RPAD function.
ADD_LIST_ELEMENT('MENU_SAL ES',1,RPAD (vk.mi_sho rtname,20, ' ')|| '- ' ||VK.u_p|| '- ' ||vk.qty|| '- ' ||vk.g_amt,vk.item);
ADD_LIST_ELEMENT('MENU_SAL
ASKER
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
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
You can try this:
ADD_LIST_ELEMENT('MENU_SAL ES',1,RPAD (RTRIM(vk. mi_shortna me),20,' ')|| '- ' ||VK.u_p|| '- ' ||vk.qty|| '- ' ||vk.g_amt,vk.item);
ADD_LIST_ELEMENT('MENU_SAL
ASKER
still it didn't make enough align
What is the length of column vk.mi_shortname ? 20 ?
This works:
select rpad(rtrim('Hela'),20,'*') from dual;
Hela****************
select rpad(rtrim('Hela2'),20,'*' ) from dual;
Hela2***************
select rpad(rtrim('Hela'),20,'*')
Hela****************
select rpad(rtrim('Hela2'),20,'*'
Hela2***************
ASKER
yes this works in seperate sql
but still in the form not
but still in the form not
If you use this, is it OK ?
ADD_LIST_ELEMENT('MENU_SAL ES',1,RPAD (RTRIM(vk. mi_shortna me),20,' '));
ADD_LIST_ELEMENT('MENU_SAL
ASKER
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
Have you try something like this, haven't you ?
ADD_LIST_ELEMENT('MENU_SAL ES',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.
ADD_LIST_ELEMENT('MENU_SAL
RPAD(RTRIM(vk.mi_shortname
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.
ASKER
yes , i adjust it , but still no
Can you put here an output ?
ASKER
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).
You can add Text as a header (put it above the list item).
ASKER
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
2-here also we will fail in aligning issue , because the header should align the details
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.
RPAD(RTRIM(vk.mi_shortname
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.
ASKER
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 ?
because align is very important for me
could you guide me on what is the code to fill in the form from a cursor ?
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;
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;
ASKER
ok
i will test it ,
thank you very much
i will test it ,
thank you very much
ASKER
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
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
I think that you can do it :)
ASKER
ok
ASKER
i used like this
ADD_LIST_ELEMENT('MENU_SAL
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