הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   [php]אפשרי ליצור קובץ WORD או ?EXEL (https://hosts.co.il/forums/showthread.php?t=59242)

Labs 21-01-08 23:36

[php]אפשרי ליצור קובץ WORD או ?EXEL
 
שלום לכולם
אפשרי ליצור נגיד ממסד נתונים שיש לי קובץ WORD או EXEL

סתם דוגמא:
נגיד יש לי שם וטלפון
בHTML להציג את זה בטבלה זה לא בעיה

אבל האם אפשרי ליצור קובץ EXEL או WORD ולסדר שם את המידע ולהביא הורדה?
ולהפך
לקחת קובץ EXEL עם הפרטים ולהכניס את זה למסד?

במידה והדבר אפשרי אמשח לקבל מדריך\פקודה\משהו שאוכל להריץ בגוגול

תודה לעוזרים:)

DanielS 22-01-08 07:33

עובד כמו גדול :
PHP קוד:

<?php 
    $fp 
fopen("test.doc"'w+');  
    
$str "<html dir=\"rtl\"><body><B>אהלן :) יצרתי קובץ וורד עם PHP</B></body></html>";  

    
fwrite($fp$str) or die("asdasd");  

    
fclose($fp);  
?>


RS324 22-01-08 09:24

PHP קוד:

<?php

$word 
= new COM("word.application") or die ("couldnt create an instance of word");

echo 
"loaded , word version{$word->version}";

//bring word to the front

$word->visible 1;

//open a word document

$word->Documents->Add();

//add some text to the document

$word->Selection->TypeText("this is some sample text in the document");

//save the document as sampleword.doc

$word->Documents[1]->SaveAs("sampleword.doc");

//close word

$word->Quit();

//free object resources

$word->Release();

$word null;

?>


Labs 22-01-08 16:16

ציטוט:

נכתב במקור על ידי RS324 (פרסם 602562)
PHP קוד:

<?php

$word 
= new COM("word.application") or die ("couldnt create an instance of word");

echo 
"loaded , word version{$word->version}";

//bring word to the front

$word->visible 1;

//open a word document

$word->Documents->Add();

//add some text to the document

$word->Selection->TypeText("this is some sample text in the document");

//save the document as sampleword.doc

$word->Documents[1]->SaveAs("sampleword.doc");

//close word

$word->Quit();

//free object resources

$word->Release();

$word null;

?>


אמממ אני יותר צריך EXEL את האמת זה יעבוד גם לזה?

reXtea 22-01-08 16:34

ציטוט:

נכתב במקור על ידי FartBoy (פרסם 602666)
אמממ אני יותר צריך EXEL את האמת זה יעבוד גם לזה?

תעשה שם Excel.Application במקום Word.Application

meshuga 22-01-08 17:20

ציטוט:

נכתב במקור על ידי RS324 (פרסם 602562)
PHP קוד:

<?php

$word 
= new COM("word.application") or die ("couldnt create an instance of word");

echo 
"loaded , word version{$word->version}";

//bring word to the front

$word->visible 1;

//open a word document

$word->Documents->Add();

//add some text to the document

$word->Selection->TypeText("this is some sample text in the document");

//save the document as sampleword.doc

$word->Documents[1]->SaveAs("sampleword.doc");

//close word

$word->Quit();

//free object resources

$word->Release();

$word null;

?>


עובד רק בPHP5 - ווינדווס שמותקן עליו אופיס...תקן אותי אם אני טועה.

Labs 22-01-08 19:33

אממ אני יתאר את מה שאני רוצה לעשות זה יעזור נראה לי

יש לי דף קשר בEXEL אני רוצה את היכולת להעביר ממנו למסד פעם אחת
ואז אני משלב את המסד בפאנל לעידכון פרטים וכו'

ואם מישהו רוצה להוריד את הקובץ זה יוצר לו קובץ EXEL מעודכן

Ori The Man 22-01-08 19:55

מצאתי את זה
http://sourceforge.net/project/downl...b.tgz&99520350

מאמין מאוד שיעזור לך


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

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