{"id":31,"date":"2010-08-21T08:51:38","date_gmt":"2010-08-21T08:51:38","guid":{"rendered":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/?p=31"},"modified":"2010-08-21T08:51:38","modified_gmt":"2010-08-21T08:51:38","slug":"export-do-excelu-v-php","status":"publish","type":"post","link":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/export-do-excelu-v-php\/","title":{"rendered":"Export do Excelu v PHP"},"content":{"rendered":"<div class=\"958545b2ffe6a18f89c3ac8a7be9162a\" data-index=\"3\" style=\"float: none; margin:0px;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-9849429965459928\";\r\n\/* Blog 300x250 \u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bdl\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00a1nky *\/\r\ngoogle_ad_slot = \"0479547637\";\r\ngoogle_ad_width = 300;\r\ngoogle_ad_height = 250;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>Pro exportov\u00e1n\u00ed do excellu z PHP jsem na\u0161el dv\u011b t\u0159\u00eddy:<br \/>\n<a href=\"http:\/\/sourceforge.net\/projects\/psxlsgen\/\">PHP Simple Excell Generator na SourceForge<\/a><br \/>\na <br \/>\n<a href=\"http:\/\/www.bettina-attack.de\/jonny\/view.php\/projects\/php_writeexcel\/\">PHP Write Excell<\/a> t\u0159\u00edda, kter\u00e1 byla p\u016fvodn\u011b napsan\u00e1 v Perlu<\/p>\n<p>Tak uvid\u00edme kter\u00e1 bude lep\u0161i. Ta druh\u00e1, n\u011bmeck\u00e1 ma alespo\u0148 p\u0159\u00edklady a dokumentace se d\u00e1 z\u00edskat z Perlovsk\u00e9ho origin\u00e1lu. Ta ze SourceForge nem\u00e1 nic.<\/p>\n<p>UPDATE<br \/>\nTak po hled\u00e1n\u00ed po v\u0161ech \u010dertech jsem nakonec na\u0161el nejlep\u0161\u00ed pomoc doma, na serveru <a href=\"http:\/\/www.interval.cz\">www.interval.cz<\/a>. Byl tam jednoduch\u00fd script, kter\u00fd mi funguje (narozd\u00edl od t\u011bch p\u0159edchoz\u00edch). Nav\u00edc jsem si ho dovolil tro\u0161ku vylep\u0161it, proto\u017ee ten Interval\u00e1ckej pouze vytv\u00e1\u0159el soubor a j\u00e1 ho cht\u011bl hned otev\u0159\u00edt.<\/p><!--CusAds0-->\n<p>Tento script je treba akor\u00e1t si ho d\u00e1t do n\u011bjak\u00e9ho .php souboru a spustit. Z\u00e1rove\u0148 je t\u0159eba vytvo\u0159it v adres\u00e1\u010di kte je ten script vytvo\u0159it adres\u00e1\u0159 &#8220;exporty&#8221; a nachmolodat ho na 777 nebo &#8220;a+w&#8221;.<\/p>\n<p>Z\u00e1rove\u0148 do prom\u011bnn\u00e9 $export ulo\u017e\u00edme v HTML k\u00f3dov\u00e1n\u00ed obsah Excellu, kter\u00fd chceme otev\u0159\u00edt.<\/p>\n<p>$soubor=&#8221;exporty\/tabulka.xls&#8221;; <br \/>\n$fp=FOpen($soubor,&#8221;w&#8221;);   \/\/ Otev\u0159eme soubor tabulka.xls, pokud existuje, bude smaz\u00e1n, jinak se vytvo\u0159\u00ed nov\u00fd soubor<br \/>\nFPutS($fp,$export);   \/\/ Zap\u00ed\u0161eme do souboru obsah<br \/>\nFclose($fp);   \/\/ Zav\u0159eme soubor<br \/>\nheader(&#8220;Content-Type: application\/x-msexcel; name=$soubor&#8221;);<br \/>\nheader(&#8220;Content-Disposition: inline; filename=$soubor&#8221;);<br \/>\n$fh=fopen($soubor, &#8220;rb&#8221;);<br \/>\nfpassthru($fh);<br \/>\nunlink($soubor);<\/p>\n<div class=\"958545b2ffe6a18f89c3ac8a7be9162a\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"pub-9849429965459928\";\r\n\/* Blog 234x60 texty, vytvo\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00c2\u00af\u00c3\ufffd\u00c2\u00bf\u00c3\ufffd\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\u00af\u00c2\u00bf\u00c2\u00bd\u00c3\ufffd\u00ef\u00bf\u00bd\u00c3\ufffd\u00c2\u00bdeno 10.1.11 *\/\r\ngoogle_ad_slot = \"1054435175\";\r\ngoogle_ad_width = 234;\r\ngoogle_ad_height = 60;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Pro exportov\u00e1n\u00ed do excellu z PHP jsem na\u0161el dv\u011b t\u0159\u00eddy: PHP Simple Excell Generator na SourceForge a PHP Write Excell t\u0159\u00edda, kter\u00e1 byla p\u016fvodn\u011b napsan\u00e1 v Perlu Tak uvid\u00edme kter\u00e1 bude lep\u0161i. Ta druh\u00e1, n\u011bmeck\u00e1 ma alespo\u0148 p\u0159\u00edklady a dokumentace se d\u00e1 z\u00edskat z Perlovsk\u00e9ho origin\u00e1lu. Ta ze SourceForge nem\u00e1 nic. UPDATE Tak po hled\u00e1n\u00ed &hellip; <a href=\"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/export-do-excelu-v-php\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Export do Excelu v PHP<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,23],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-export-do-excelu-php","tag-php"],"_links":{"self":[{"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":1,"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":32,"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/posts\/31\/revisions\/32"}],"wp:attachment":[{"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/6378.wms78.wedos.ws\/subdom\/blog\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}