freak Posted January 25, 2008 Report Share Posted January 25, 2008 Mēģinu noeksportēt datus no Datubāzes uz Exceli. Viss ir ok. Tikai garumzīmes nestrādā. Varbūt kāds ar kautko līdzīgu saskāries vai arī zin, kas par vainu. Eksportam izmantoju šādu metodi: header("Content-type: application/x-msdownload; charset=UTF-8"); header("Content-Disposition: attachment; filename=export.xls"); header("Pragma: no-cache"); header("Expires: 0"); print "$header\n$data"; Link to comment Share on other sites More sharing options...
andrisp Posted January 25, 2008 Report Share Posted January 25, 2008 Ja nemaldos, tad excelim ir ļoti svarīgi, lai UTF-8 dokumenta sākumā būtu BOM simboli. Savādāk nesapratis, ka UTF-8. Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 25, 2008 Report Share Posted January 25, 2008 tā kā man arī drīz nāksies šo realizēt - vai iespējams norādīt stilus šūnām, rindām? (css, inline-css?) Link to comment Share on other sites More sharing options...
freak Posted January 25, 2008 Author Report Share Posted January 25, 2008 Ja nemaldos, tad excelim ir ļoti svarīgi, lai UTF-8 dokumenta sākumā būtu BOM simboli. Savādāk nesapratis, ka UTF-8. kaa vinjus tur dabut, ja taa tiesham ir? Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 25, 2008 Report Share Posted January 25, 2008 faila sākumā pieliec U+FEFF http://unicode.org/faq/utf_bom.html#BOM Link to comment Share on other sites More sharing options...
andrisp Posted January 25, 2008 Report Share Posted January 25, 2008 Paulinjsh, es līdz šim esmu izbraucis vienkārši saglabājot HTML dokumentu (Stili ir iekš head <style> taga vai arī inlainā) ar XLS paplašinājumu. Strādā lieliski. :) Cik pārbaudīju, tad ne 2003, ne 2007. nav problēmu. Un jā, var šūnas atsevišķi stilot. CSS padding gan ignorē. Link to comment Share on other sites More sharing options...
Paulinjsh Posted January 25, 2008 Report Share Posted January 25, 2008 o, tnx andrisp. tā jau arī domāju :) Link to comment Share on other sites More sharing options...
freak Posted January 25, 2008 Author Report Share Posted January 25, 2008 faila sākumā pieliec U+FEFF http://unicode.org/faq/utf_bom.html#BOM Ka man iisti vinjus uzlikt? Laikam nepareizi to daru. Megjinaju shadi, bet nedarbojas: header("Content-type: application/x-msdownload;charset=UTF-8"); header("Content-Disposition: attachment; filename=export.xls"); header("Pragma: no-cache"); header("Expires: 0"); $b="U+FEFF"; print "$b$header\n$data"; gan shadi : print "$header$b\n$data"; gan shadi: print "$header\n$b$data"; Link to comment Share on other sites More sharing options...
andrisp Posted January 25, 2008 Report Share Posted January 25, 2008 Ne ne, tā ne. Šādi var mēģināt: echo chr(239).chr(187).chr(191).$pats_dokuments; EF BB FB ir hexadecimālais attēlojums tiem cipariem. Par to, ko dara chr, skaties manuālī. Link to comment Share on other sites More sharing options...
freak Posted January 25, 2008 Author Report Share Posted January 25, 2008 Ne ne, tā ne.Šādi var mēģināt: echo chr(239).chr(187).chr(191).$pats_dokuments; EF BB FB ir hexadecimālais attēlojums tiem cipariem. Par to, ko dara chr, skaties manuālī. PAldies! ;) Link to comment Share on other sites More sharing options...
andrisp Posted January 25, 2008 Report Share Posted January 25, 2008 Sanāca ? LV simboli darbojas ? Link to comment Share on other sites More sharing options...
freak Posted January 25, 2008 Author Report Share Posted January 25, 2008 LV simboli darbojas tikai nobide veidojas. Pa kolonam :( Link to comment Share on other sites More sharing options...
Chepa Posted January 26, 2008 Report Share Posted January 26, 2008 (edited) Excelim vispār iesaku lietot attiecīgo pear klasi. Varēsi smuki sabūdīt ij kolonnas, ij krāsas salikt, ij borerus, freeze pointus e.t.c Bet ja rodas problēmas ar garumzīmēm - lieto utf8 klasi Katrā ziņā man šitā divas lietas kopā strādā uz urrā. Edited January 26, 2008 by Chepa Link to comment Share on other sites More sharing options...
Paulinjsh Posted February 1, 2008 Report Share Posted February 1, 2008 Uztaisīju vienkāršu html un padevu headerus: header("Content-Disposition: attachment; filename=phone_export.xls"); header( "Content-Type: application/octet-stream"); header( "Content-Type: application/force-download"); header( "Content-Type: application/download"); header( "Content-Transfer-Encoding: binary" ); nekādas problēmas ar utf-8 nebija Link to comment Share on other sites More sharing options...
andrisp Posted February 1, 2008 Report Share Posted February 1, 2008 Paulinjsh, padevi bez BOM ? Link to comment Share on other sites More sharing options...
Recommended Posts