הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 23-03-09, 13:52   # 1
spi7fire
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2008
הודעות: 325
שלח הודעה באמצעות ICO אל spi7fire

spi7fire לא מחובר  

יצוא תוכן של דף לאקסל (excel)

היי חבר'ה,
אני רוצה לייצא טבלה שאני מציג ללקוח (מדפיס אותה עם php) לקובץ ecxel ולפתוח את הקובץ לאחר היצירה (ע"י לחיצה על כפתור)

מישהו מכיר קוד שעושה את זה?

תודה
  Reply With Quote
ישן 23-03-09, 14:59   # 2
Adir
חבר מתקדם
 
מיני פרופיל
תאריך הצטרפות: Feb 2006
הודעות: 685
שלח הודעה באמצעות MSN אל Adir

Adir לא מחובר  

http://www.google.co.il/search?hl=iw...+excel&spell=1
  Reply With Quote
ישן 23-03-09, 22:15   # 3
spi7fire
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2008
הודעות: 325
שלח הודעה באמצעות ICO אל spi7fire

spi7fire לא מחובר  

גם אני יודע לחפש בגוגל. לא סתם שאלתי כאן בפורום אם מישהו מכיר קוד שעושה את זה, כי אם היית פחות מתעצל ובאמת מסתכל על התוצאות היית רואה שאין שם משהו באמת ברור שאפשר להשתמש בו.
  Reply With Quote
ישן 24-03-09, 00:05   # 4
intercooler3819
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Jul 2008
הודעות: 1,056

intercooler3819 לא מחובר  

http://.co.il/dev/xls_creation/

הקוד..
PHP קוד:
<?php
$content 
"";

if (isset(
$_POST['cn49c']))
{
    function 
xlsBOF()
    {
        echo 
pack("ssssss"0x8090x80x00x100x0,0x0);
    }

    function 
xlsEOF()
    {
        echo 
pack("ss"0x0A0x00);
    }

    function 
xlsWriteNumber($Row$Col$Value)
    {
        echo 
pack("sssss"0x20314$Row$Col0x0);
        echo 
pack("d"$Value);
    }

    function 
xlsWriteLabel($Row$Col$Value)
    {
        
$L strlen($Value);
        echo 
pack("ssssss"0x204$L$Row$Col0x0$L);
        echo 
$Value;
    }

    
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");;
    
    if (
preg_match("/^[0-9a-zA-Z]+$/"$_POST['x95nc']))
        
header("Content-Disposition: attachment;filename=" $_POST['x95nc'] . ".xls ");
    
elsez
        header
("Content-Disposition: attachment;filename=nitsan_" rand(09999) . ".xls ");
    
    
header("Content-Transfer-Encoding: binary");

    
xlsBOF();

    
xlsWriteLabel(0,0,"List of values:");

    
$content explode("\n"$_POST['cn49c']);
    for (
$i 0$i count($content); $i++)
    {
        
$content[$i] = explode(","$content[$i]);
        for (
$j 0$j count($content[$i]); $j++)
            if (
preg_match("/^([0-9]+|\.[0-9]+|[0-9]+\.[0-9]+)$/"$content[$i][$j]))
                
xlsWriteNumber($i$j$content[$i][$j]);
            else
                
xlsWriteLabel($i$j$content[$i][$j]);
    }

    
xlsEOF();
    exit;
}
else
{
$content .= <<<EOF
Each new line is new row and ',' is the cols separator<br />
<form action="index.php" method="post">
Filename:&nbsp;<input type='text' value='' name='x95nc' />.xls<br />
<textarea name="cn49c" cols="60" rows="8"></textarea>
<div class='button'><input type="submit" value="xls it!" /></div>
</form>
EOF;
}
__________________
  Reply With Quote
ישן 24-03-09, 20:20   # 5
spi7fire
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2008
הודעות: 325
שלח הודעה באמצעות ICO אל spi7fire

spi7fire לא מחובר  

וואי ניצן, תודה רבה! אתה מלך!

זה עובד כמו סוס..
  Reply With Quote
ישן 24-03-09, 23:42   # 6
0xfo7d
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 292
שלח הודעה באמצעות ICO אל 0xfo7d

0xfo7d לא מחובר  

היי ניצן,
ניסיתי גם את הקוד...הוא נותן שגיאה:
Parse error: syntax error, unexpected T_STRING in /home/***/domains/***/public_html/***.php on line 39
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 15:11.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ