from sandip : error in excel file

To discuss Oracle Forms & Reports related technical issues.
Post Reply
sandip
Posts: 2
Joined: Wed Aug 23, 2006 2:24 am
Location: India

from sandip : error in excel file

Post by sandip »

hi all,
i have written a text_io package in D2K forms 6i to generate
data to an Excel File.It is correctly inserting data into the excel file from
the form.But the problem is if i open the excel file and do some modification anywhere i mean in any cell,save and then come out, and again if i run the form, data is not getting inserted in the excel file.

i am sending the text_io package.Pls help me out.

Thanx..

Sandip...

================= here is the code ================
declare

out_file Text_IO.File_Type;
/* these are the variables to hold my fields */
v_client_name varchar2(50);
v_recruiter_emailid varchar2(50);
v_recruiter_name varchar2(50);
v_candidate_name varchar2(50);
v_yrs_ofexp_total number(4);
v_yrs_ofexp_it number(4);
v_skillset_primary varchar2(50);
v_skillset_secondary varchar2(50);
v_emailid varchar2(50);
v_contact_no varchar2(50);
v_permanent_contract varchar2(50);
v_resource_executive_name varchar2(50);

begin
out_file := Text_IO.Fopen('c:\sandip\NEW_CENTRAL_EXCEL_FILE_FORMAT.xls', 'a');
v_client_name := name_in('cv_process1.client_name');
v_recruiter_emailid := name_in('cv_process1.recruiter_emailid');
v_recruiter_name := name_in('cv_process1.recruiter_name');
v_candidate_name := name_in('cv_process1.candidate_name');
v_yrs_ofexp_total := name_in('cv_process1.yrs_ofexp_total');
v_yrs_ofexp_it := name_in('cv_process1.yrs_ofexp_it');
v_skillset_primary := name_in('cv_process1.skillset_primary');
v_skillset_secondary := name_in('cv_process1.skillset_secondary');
v_emailid := name_in('cv_process1.emailid');
v_contact_no := name_in('cv_process1.contact_no');
v_permanent_contract := name_in('cv_process1.permanent_contract');
v_resource_executive_name := name_in('cv_process1.resource_executive_name');

if Text_IO.Is_Open(out_file)
then loop
Text_IO.New_Line(out_file);
Text_IO.Put(out_file,v_client_name);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_recruiter_emailid);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_recruiter_name);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_candidate_name);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_yrs_ofexp_total);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_yrs_ofexp_it);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_skillset_primary);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_skillset_secondary);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_emailid);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_contact_no);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_permanent_contract);
Text_IO.Put(out_file, CHR(9));
Text_IO.Put(out_file,v_resource_executive_name);

IF :system.last_record = 'TRUE' THEN
EXIT;
ELSE
next_record;
END IF;
end loop;
Text_IO.Fclose(out_file);
end if;
end;
end if;

end;
Kashif
Posts: 137
Joined: Wed Apr 26, 2006 5:57 am
Location: Pakistan
Contact:

Post by Kashif »

I never Work on Handling Files in the Developer 2K.

But from ur Coding i am thinking that u are creating a Text file not any Excel file. SIMPLY A text File with XLS Extension.

Except this Procedure u if u create a Simple Text file Using NotePad for Example ABC.TXT and Open it in the Excel it can be OPEN in the Excel easily. But if u save that in Excel then u can not open it in the NOTEPAD in that format u save.

Simply this Method applied to the Procedure which u write in Developer 2K.
When u create File from TEXT_IO Package there is no error.
and when u OPEN File in Excel and save it. now its File Format Has Change. and can only be Readable using Excel not by Developer 2K.
that is why Developer is Giveing Error when u want to Insrt the Values in which file whcih is changed by EXCEL.

Might Possibe i'm wrong bcz i have never Work on Files in developer.
If i'm wrong then Sorry for all the OBOVE.

<font size="2"><font color="blue"><font face="Tahoma"><b>Best Regards.

Muhammad Kashif</b></font id="Tahoma"></font id="blue"></font id="size2">
sandip
Posts: 2
Joined: Wed Aug 23, 2006 2:24 am
Location: India

Post by sandip »

hi Muhammad Kashif,
u r correct in all the things u said except one point ie, my code is creating an excel file. i am now looking after the matter. anyway,thanx a lot for ur idea.

Sandip Das...
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests