my $sql1 = "select deptid,to_char(a.epfno) epfno,a.ename ename,desig,decode(b.status,'P','उपस्थित','A','अवकाश','D','प्रतिनियुक्ति') status,b.rmk from Atnd_emp_mast a,Atnd_position b where repoid=1 and ISACTIVE=0 and a.epfno=b.epfno and SUMM_HOD_FLAG=1 and ATTEN_DT=to_date('17-12-2020','DD-MM-YYYY') order by SUMM_SORTID"; $sth =$dbh->prepare($sql1); $sth->execute(); $out = DBIx::Dump->new('format' => excel, # excel or csv 'output' => $f1, # file to save as 'sth' => $sth); $out->dump(); print "Report Generated with file name $f1 \n"; $f2 = join".",$f1,"xls"; system "copy $f1 $f2"; print "$f2 \n";