dear everyone
i am exporting my data to *.xls format and it working very well and here it is my code

PHP Code:
    //    echo 'here';
function xlsBOF() {
    echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);  

function xlsEOF() {
    echo pack("ss", 0x0A, 0x00);

function xlsWriteNumber($Row, $Col, $Value) {
    echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
    echo pack("d", $Value);

function xlsWriteLabel($Row, $Col, $Value ) {
    $L = strlen($Value);
    echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
    echo $Value;

 // Query Database

    $select_query1 =  $_SESSION['query'];
    //print "select_query1: " . $select_query1 . "<br>";
    $res_query1 = mysql_query($select_query1)
    or die ("table error: " . mysql_error());
$res_rows = mysql_num_rows($res_query1);
//echo $res_rows;
//$tr_res_query1 = mysql_fetch_array($res_query1);


     header("Pragma: public");
    header("Expires: 0");

    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-Type: application/force-download");
    header("Content-Type: application/octet-stream");
    header("Content-Type: application/download");
    header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
    header("Content-Disposition: attachment;filename=Action_Report_".date('dmys').".xls");
    header("Content-Transfer-Encoding: binary ");
//      dato                          
    // XLS Data Cell

                xlsWriteLabel(0,1,"Action Date");
                xlsWriteLabel(0,3,"Travel Agency");                
                xlsWriteLabel(0,4,"Office ID");
                xlsWriteLabel(0,5,"Terminal ID");
                xlsWriteLabel(0,8,"Insert Date");                                                        

                $xlsRow = 1;    
                    while ($tr_res_query1 = mysql_fetch_array($res_query1))
                                                            {    $inserted_dato=date("M j, Y h:i A", strtotime($tr_res_query1['datetimeo']));
                          xlsWriteLabel($xlsRow,1, date('D dS \ M Y', strtotime($tr_res_query1['ActionDate'])));
                          xlsWriteLabel($xlsRow,2, $tr_res_query1['Action']);
                          xlsWriteLabel($xlsRow,4, $tr_res_query1['OID']);
                          xlsWriteLabel($xlsRow,5, $tr_res_query1['ATID']);
                          xlsWriteLabel($xlsRow,6, $tr_res_query1['SignInitials']);        
                          xlsWriteLabel($xlsRow,7, $tr_res_query1['Comments']);    


my problem is that i need to export these data to *.xlsx format, i tried to make the name to
PHP Code:
but it did not work

does anyone has a module or source code to make this task

i need it quickly please