from sandip : error in excel file
Posted: Wed Aug 23, 2006 3:01 am
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;
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;