Home » Developer & Programmer » Forms » Calender Control in From 6i
icon9.gif  Calender Control in From 6i [message #111808] Sun, 20 March 2005 23:31 Go to next message
Sabeen
Messages: 25
Registered: March 2005
Location: Pakistan
Junior Member
Hi,
Can anyone help me in, how to add calender control in forms 6i.
thanx
Re: Calender Control in From 6i [message #111859 is a reply to message #111808] Mon, 21 March 2005 06:44 Go to previous messageGo to next message
rzkhan
Messages: 370
Registered: March 2005
Senior Member
You will need to files
1) stndrd.olb
2) calendar.pll
******************
1) From within forms open the file stndrd.old via file, open. This will add the item "standards" to the object navigator/object libraries section. This will now always appear in the object navigator.

2) Next open the form that you wish the calendar to be on.

3) Expand the "library tabs" section of the "standards" item in "object libraries" to reveal 5 items, inc. "components". Right click on "components" & select "object libraries" from the menu that appears.

4) From the box that appears select the component "calendar" and drag it to the form you wish it to be added to within the "object navigator". It will then ask whether you want to "sub-class" or "copy". Select copy, or the form with the calendar will not work on PC's that does not have the standards item added. Copying will add all required bits you need for the calendar.

5) Next open the "calendar.pll" file & this will add a "calendar" item to the "pl/sql libraries" section on the "object navigator". Select the "program unit" section and drag it up to the "programs unit" section of your form. This will add 2 items to the "programs unit" section (date_lov - package spec & date lov -package body).

6) Next add a button to call the calendar with a "when_button_pressed" trigger & added this code.
********************************
date_lov.get_date(sysdate,
'cbk.item5', -- return block.item
240, -- window x position
60, -- window y position
'Date', -- window title
'OK', -- ok button label
'CANCEL', -- cancel button label
TRUE, -- highlight weekend days
FALSE, -- autoconfirm selection
FALSE); -- autoskip after selection
********************************
The block.item is where you want the date to be inserted into via the calendar user interaction.

Riaz Laughing
Re: Calender Control in From 6i [message #234697 is a reply to message #111859] Wed, 02 May 2007 23:03 Go to previous messageGo to next message
karthick2809
Messages: 50
Registered: April 2007
Location: Chennai
Member
i have used the methos whick you have mentioned..its works finr..but i want the user to choose the time also..i am able to get only the date..please help me out..
Re: Calender Control in From 6i [message #235195 is a reply to message #234697] Fri, 04 May 2007 05:11 Go to previous messageGo to next message
rzkhan
Messages: 370
Registered: March 2005
Senior Member

under the Program Units select DATE_LOV(Package Body)

change the following line
copy(to_char(date_lov.current_lov_date), date_lov.date_lov_return_item);

as

copy(to_char(date_lov.current_lov_date,'dd-mm-yyyy hh:mi'), date_lov.date_lov_return_item);


I have tested it .. it works fine

Thank you,
Riaz


Re: Calender Control in From 6i [message #235846 is a reply to message #235195] Tue, 08 May 2007 02:47 Go to previous messageGo to next message
karthi_smarty04
Messages: 19
Registered: January 2007
Location: COIMBATORE
Junior Member
thanks for your help..the coding is like this..should i change in all of the following code


package body date_lov is

procedure set_day_labels
is
begin
-- if November 8, 1996 is the fifth day of the week, then
-- display the labels in ISO style with Monday as
-- the first day of the week
-- else November 8, 1996 is the sixth day of the week, then
-- display the labels in American style with Sunday as
-- the first day of the week

if to_char(to_date('11/08/1996','mm/dd/yyyy'),'d') = '5' then
weekend_day1 := 6;
weekend_day2 := 7;
copy(to_char(to_date('11/04/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label1');
copy(to_char(to_date('11/05/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label2');
copy(to_char(to_date('11/06/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label3');
copy(to_char(to_date('11/07/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label4');
copy(to_char(to_date('11/08/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label5');
copy(to_char(to_date('11/09/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label6');
copy(to_char(to_date('11/10/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label7');
else
weekend_day1 := 1;
weekend_day2 := 7;
copy(to_char(to_date('11/03/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label1');
copy(to_char(to_date('11/04/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label2');
copy(to_char(to_date('11/05/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label3');
copy(to_char(to_date('11/06/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label4');
copy(to_char(to_date('11/07/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label5');
copy(to_char(to_date('11/08/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label6');
copy(to_char(to_date('11/09/1996','mm/dd/yyyy'),'Dy'),
'date_control_block.day_label7');
end if;
end set_day_labels;
Re: Calender Control in From 6i [message #235907 is a reply to message #235846] Tue, 08 May 2007 06:46 Go to previous messageGo to next message
rzkhan
Messages: 370
Registered: March 2005
Senior Member
only one line in

Procedure date_click



Re: Calender Control in From 6i [message #235956 is a reply to message #235907] Tue, 08 May 2007 09:07 Go to previous messageGo to next message
karthick2809
Messages: 50
Registered: April 2007
Location: Chennai
Member
thanks a lot..
it works fine...
but my requirement is to make the user to choose the time also..As i am developing a truking system time factor is much important..please help me out
Re: Calender Control in From 6i [message #236762 is a reply to message #235956] Thu, 10 May 2007 21:35 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Give them a numeric field and get them to type it in.

David
Previous Topic: label allignment problem
Next Topic: a strange problem
Goto Forum:
  


Current Time: Thu Sep 26 22:47:07 CDT 2024