|  | 
	                
  
    | 
	 
        เนื่องจาก ใส่  header("Content-Type: application/vnd.ms-excel");  header(Content-Disposition: attachment; filename="Report.xls");ไม่แสดงข้อมูลใน Excel แต่พอเอาออก พบว่าข้อมูลมี     |  
    |  |  
 
	
		|  |  |  |  |  
		|  |  | 
          
            | เนื่องจาก ใส่ header("Content-Type: application/vnd.ms-excel");
 header('Content-Disposition: attachment; filename="Report.xls"');#????????
 ไม่แสดงข้อมูลใน Excel แต่พอเอาออก พบว่าข้อมูลมี
 รบกวนช่วยหน่อยค่ะ
 
 
  Code (PHP)
 
  <?php  
 header("Content-Type: application/vnd.ms-excel");
 header('Content-Disposition: attachment; filename="Report.xls"');#????????  
 
    $INPUT = '23445';
    require_once("./../Config_Rfc/saprfc.php");
    require_once("./../Config_Rfc/config_rfc_400.php");
        $result=$sap->callFunction("Z_GET_REPORT",
		array(array("IMPORT","I_INPUT",$INPUT ),
		array("TABLE","T_table",array())
		));	
 
		
	if($sap->getStatus() == SAPRFC_OK) {  
 foreach ($result['T_TOTAL'] as $sum_bsis){  
echo  $sum_bsis['PERIOD02'];
 }
 
 
 	 	}else{ 
		$sap->printStatus(); 
	    }
		 $sap->logoff(); 
?>
 
  Code (PHP)
 
  <?php  
    $INPUT = '23445';
    require_once("./../Config_Rfc/saprfc.php");
    require_once("./../Config_Rfc/config_rfc_400.php");
        $result=$sap->callFunction("Z_GET_REPORT",
		array(array("IMPORT","I_INPUT",$INPUT ),
		array("TABLE","T_table",array())
		));	
 
		
	if($sap->getStatus() == SAPRFC_OK) {  
 foreach ($result['T_TOTAL'] as $sum_bsis){  
echo  $sum_bsis['PERIOD02'];
 }
 
 
 	 	}else{ 
		$sap->printStatus(); 
	    }
		 $sap->logoff(); 
?>
 
 
 Tag : PHP, Ms SQL Server 2008, HTML, JavaScript, Excel (Excel.Application), Laravel  Framework
 
 
 |  
            |  |  
            | 
              
                |  |  |  |  
                |  | 
                    
                      | Date :
                          2021-04-29 15:19:06 | By :
                          mewhappy | View :
                          2335 | Reply :
                          6 |  |  |  
                |  |  |  |  |  
            |  |  
		            |  |  
		|  |  |  |  |  
  
    | 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | แนะนำให้ใช้ phpExcel ในการ Export ข้อมูลรูปแบบ Excel ครับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2021-04-29 17:24:18 | By :
                            arm8957 |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
 
 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | 
 |  
              | 
 ประวัติการแก้ไข
 2021-04-30 09:57:48
 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2021-04-30 09:57:06 | By :
                            mewhappy |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | Code (PHP) 
 <?php
$files = "test.xls";
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=".$files);
?>
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head></head>
ลองแบบนี้ดูครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2021-05-01 19:41:11 | By :
                            ซ้ำกับมั่วๆ |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  |  |