Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

PHP -> XLS

[es] :: PHP :: PHP -> XLS

[ Pregleda: 6223 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

milost

Član broj: 58
Poruke: 51
*.deltayu.com



Profil

icon PHP -> XLS14.01.2002. u 09:36 - pre 270 meseci
Izvesni C. Novak napisao je classu za generisanje xls tabele.
mozete pogledati na

http://home.arcor.de/cnovak/biff/biffintro.html

sve je iscrpno objasnjeno i napisano, ali meni ne uspeva da napravim bilo kakav xls. Da li je neko probao i da mu pri tom radi?

poz
 
Odgovor na temu

tom rider
SLO

Član broj: 2635
Poruke: 15
193.189.186.*



Profil

icon Re: PHP -> XLS05.03.2002. u 14:29 - pre 268 meseci
ne treba ti nikakav class. Samo copy-paste ove skripte u nov .php file.

<?
Header("Content-Disposition: inline; filename=test.xls");
Header("Content-Description: PHP Generated Data");
Header("Content-type: application/vnd.ms-excel; name='My_Excel'");
flush;

print "
<table cellspacing=0 cellpadding=1 border=1>
<tr>\n
<td bgcolor=\"#FFFF00\">Test1</td>\n
<td bgcolor=\"#FF0000\">Test2</td>\n
</tr>\n";

print "
<tr>\n
<td bgcolor=\"#0000FF\"><font color=\"ffffff\">Test3</font></td>\n
<td bgcolor=\"#00FF00\">Test4</td>\n
</tr>\n";

print "</table>\n";
?>

Pozdrav

Tom rider
 
Odgovor na temu

leka
Dejan Lekić
senior software engineer, 3Developers
Ltd.
London, UK

Član broj: 234
Poruke: 2534
*.telia.com

Sajt: dejan.lekic.org


+2 Profil

icon Re: PHP -> XLS14.03.2002. u 06:56 - pre 268 meseci
Hehe, po ovom fazonu je onda najbolje generisati CSV fajl koji ceo svet razume, pa cak i Excel ...
Dejan Lekic
software engineer, MySQL/PgSQL DBA, sysadmin
 
Odgovor na temu

tom rider
SLO

Član broj: 2635
Poruke: 15
193.189.186.*



Profil

icon Re: PHP -> XLS15.03.2002. u 08:50 - pre 268 meseci
Ok leka, onda probaj sa time:

<?php
// Excel begin of file header
function xlsBOF() {
echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
return;
}
// Excel end of file footer
function xlsEOF() {
echo pack("ss", 0x0A, 0x00);
return;
}
// Function to write a Number (double) into Row, Col
function xlsWriteNumber($Row, $Col, $Value) {
echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
echo pack("d", $Value);
return;
}
// Function to write a label (text) into Row, Col
function xlsWriteLabel($Row, $Col, $Value ) {
$L = strlen($Value);
echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
echo $Value;
return;
}

Header ("Content-type: application/vnd.ms-excel; name='My_Excel'");
header ("Content-Disposition: attachment; filename=test.xls" );
header ("Content-Description: PHP Generated Data" );
flush;



xlsBOF(); // begin Excel stream
xlsWriteLabel(0,0,"Vsem lep pozdrav");//Text- A1
xlsWriteLabel(1,0,"Tom rider"); //Text- A2
xlsWriteNumber(0,1,0123456789); // Number B1
xlsWriteNumber(3,6,0123456789); // Number G4
xlsEOF(); // close the stream
?>

Tom rider
 
Odgovor na temu

[es] :: PHP :: PHP -> XLS

[ Pregleda: 6223 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.