게시물 엑셀 다운로드시

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
게시물 엑셀 다운로드시

QA

게시물 엑셀 다운로드시

본문

게시물 엑셀 다운로드시 전화번호도 같이 엑셀로 받게끔 되어있는데요

만약 전화번호가 0 1 0-1 0 2 3-0 0 2 3 이면

다운받은 엑셀에 표시되는건 10-1023-23만 표시됩니다

숫자앞에 0이 있으면 엑셀에서 표시를 안하더라구요

 

해결방법이 있을까요??

스킨게시판에있는 n_xls 수정해서 사용중입니다 

이 질문에 댓글 쓰기 :

답변 3

무슨 스킨인지 모르지만 전화번호가 들어가는 td에 style 주세요.

<td style="mso-number-format:'\@'"><?=$~~~?></td> 

엑셀이 숫자이면 앞에 0을 지우는 현상일수도 있습니다.

 

번거롭더라도 해당 셀이나 행, 열을 선택하고 마우스 오른쪽 버튼, 셀 서식에서

"일반" 또는 "텍스트" 로 선택하고 확인버튼을 눌러보세요.

 

예전에 한번 해봤더니 앞에 0이 보이더라구요.

 

 

php로 제어하는건 모르겠네요.

전체소스는,,<?
include_once("./_common.php");
include_once("$g4[admin_path]/admin.lib.php");


 $sql_order = " order by wr_num, wr_reply ";

 if ($sca || $stx)
 {
  $sql = " select distinct wr_parent from $write_table where $sql_search $sql_order ";
 }
 else
 {
  $sql = " select * from $write_table where wr_is_comment = 0 $sql_order ";
 }

    $result = sql_query($sql);
    $cnt = @mysql_num_rows($result);
    if (!$cnt)
        alert("출력할 내역이 없습니다.");
 
    header('Content-Type: application/vnd.ms-excel');
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header('Content-Disposition: attachment; filename="list' . date("ymd", time()) . '.xls"');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header('content-transfer-encoding: binary');
 echo "<html><head>";
 echo "<meta http-equiv='Content-Type' content='application/vnd.ms-excel'>";

 echo "</head><body>";
    echo "<table border=1 style='font-family:돋움; font-size:10pt; bgcolor:#D35C5E;'><tr>";
    echo "

 <td align=center height=40 style='color:#D35C5E;'><b>등록날짜</b></td>
 <td align=center style='color:#D35C5E;'><b>상담자</b></td>
 <td align=center style='color:#D35C5E;'><b>연락처</b></td>

 
 </tr>\n";
    for ($i=0; $row=mysql_fetch_array($result); $i++)
    {
  echo "<tr>\n";
        echo "<td align=center height=30>" . $row[wr_datetime] . "</td>\n";
        echo "<td align=center style=mso-number-format:'\@';>" . $row[wr_8] . "</td>\n";
        echo "<td align=center style=mso-number-format:'\@';>" . $row[wr_1] . -$row[wr_2]. -$row[wr_3]. "</td>\n";


    

    }
 echo "</table>";
 echo "</body></html>";
    if ($i == 0)
        alert("자료가 없습니다.");

    exit;

?>

 

이런식으로 되어있습니다 

html이랑 php를 저렇게 쓰시면 이스케이프도 힘들고...
echo "<td align=center style=mso-number-format:'\@';>" . $row[wr_8] . "</td>\n";
-->
echo "<td align=center class='str'>asdfasdfasdf</td>\n";
이렇게 class로 지정하신 후에
상단에서 스타일을 따로 지정해 주세요.
.str { mso-number-format:"\@"; }

답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT