|
|
|
เขียน report excel แล้วภาษาไทยไม่แสดงทำไงค่ะ ช่วยหน่อยค่ะ |
|
|
|
|
|
|
|
Code (PHP)
$sql='SELECT [No_],[Name],[Account Type],[Debit_Credit] ';
$sql.=',[Blocked],[Direct Posting],[Reconciliation Account] ';
$sql.=',[Gen_ Posting Type] ,[Gen_ Bus_ Posting Group],[Gen_ Prod_ Posting Group] ';
$sql.=',[VAT Bus_ Posting Group],[VAT Prod_ Posting Group] ';
$sql.=',[WHT Business Posting Group],[WHT Product Posting Group] ';
$sql.='FROM [TAE2012].[dbo].[Inventory Monitor$G_L Account] ';
if($datepicker!=''){$sql.="WHERE [Last Date Modified] Between '$day1' and '$day2' ";}
//print $sql;
$stmt = sqlsrv_query( $conn, $sql);
// $row2=sqlsrv_num_rows($stmt);
$a=2;
while( $row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC) ){
// Miscellaneous glyphs, UTF-8
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A'.$a,$row['No_'])
->setCellValue('B'.$a,$row['Name'])
->setCellValue('C'.$a,$row['Account Type'])
->setCellValue('D'.$a,$row['Debit_Credit'])
->setCellValue('E'.$a,$row['Blocked'])
->setCellValue('F'.$a,$row['Direct Posting'])
->setCellValue('G'.$a,$row['Reconciliation Account'])
->setCellValue('H'.$a,$row['Gen_ Posting Type'])
->setCellValue('I'.$a,$row['Gen_ Bus_ Posting Group'])
->setCellValue('J'.$a,$row['Gen_ Prod_ Posting Group'])
->setCellValue('K'.$a,$row['VAT Bus_ Posting Group'])
->setCellValue('L'.$a,$row['VAT Prod_ Posting Group'])
->setCellValue('M'.$a,$row['WHT Business Posting Group'])
->setCellValue('N'.$a,$row['WHT Product Posting Group']);
$a=$a+1;
}
// Rename worksheet
$objPHPExcel->getActiveSheet()->setTitle('Simple');
Tag : PHP, Ms SQL Server 2005
|
|
|
|
|
|
Date :
2015-05-27 14:09:25 |
By :
rattanaja |
View :
737 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วค่ะ...ขอบคุณค่ะ
|
|
|
|
|
Date :
2015-05-28 13:45:32 |
By :
rattanaja |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|