Laravel-excel: Hapus Kutipan dari csv

Dibuat pada 22 Mei 2015  ·  3Komentar  ·  Sumber: Maatwebsite/Laravel-Excel

Hai semuanya, saya mendapatkan file CSV yang diekspor, tetapi setiap data sel memiliki tanda kutip.. Bisakah Anda membantu saya menghapus tanda kutip saat mengekspor ke CSV? di sini sebuah contoh:
"20150521", "62549", "2492","", "16.52", "1,98", "0", "0", "0","", "922330816001","","","P ","","2492"
"20150521", "71343", "2493","", "8,26", "0,99", "0", "0", "0","", "922330816001","","","P ","","2493"
Saya ingin ini..
20150521.62549.2492,,16.52.1.98,0,0,0,,922330816001,,,P,,2492
20150521,71343,2493,,8.26,0.99,0,0,0,,922330816001,,,P,,2493
Terima kasih

ini kode saya:

//generating .csv
$csv = Excel::create($conciliacion->nombre, function($excel){
            $excel->sheet('Lista', function($sheet) {
                $empresa = Empresa::find(1);
                $conciliacion = Session::get('conciliacion');
                Session::forget('conciliacion');
                $fecha_conciliacion = $conciliacion->fecha;

                $i = 1;
                $ordenes = Orden::whereBetween('fecha_emision', array($fecha_conciliacion.' 00:00', $fecha_conciliacion.' 23:59'))->get();
                var_dump($ordenes);
                foreach($ordenes as $o){
                    $sheet->row($i, array(
                        (int)date("Ymd", strtotime($o->fecha_emision)),
                        (int)date("His", strtotime($o->fecha_emision)),
                        (int)$o->numero_orden,
                        (int)$o->tipo_tarjeta,
                        (float)number_format(($o->subtotal_12+$o->subtotal_0), 2),
                        (float)number_format($o->iva, 2),
                        (float)'0.00',
                        (float)number_format($o->intereses/100, 2),
                        (float)number_format($o->total_intereses/100, 2),
                        (int)$o->numero_autorizacion,
                        (int)$empresa->ruc,
                        (int)$o->tipo_credito,
                        (int)$o->meses_credito,
                        'P',
                        '',
                        (int)$o->numero_orden,
                    ));
                    $i++;
                }
            });
        })->export('csv');

Komentar yang paling membantu

Anda harus mengubah pengaturan enclosure di konfigurasi: https://github.com/Maatwebsite/Laravel-Excel/blob/master/src/config/excel.php#L129

Semua 3 komentar

Anda harus mengubah pengaturan enclosure di konfigurasi: https://github.com/Maatwebsite/Laravel-Excel/blob/master/src/config/excel.php#L129

Luar biasa, Di Laravel, file konfigurasinya adalah: ../vendor/maatwebsite/excel/src/config/csv.php terima kasih..
Ini akan membutuhkan lebih banyak dokumentasi tentang konfigurasi. apapun terima kasih sekali lagi.

Jika Laravel 4 itu. Contoh yang saya berikan adalah untuk Laravel 5, yang memiliki cara berbeda dalam menangani konfigurasi.

Apakah halaman ini membantu?
0 / 5 - 0 peringkat

Masalah terkait

lucatamtam picture lucatamtam  ·  3Komentar

rossjcooper picture rossjcooper  ·  3Komentar

kevinRR picture kevinRR  ·  3Komentar

wwendorf picture wwendorf  ·  3Komentar

alejandri picture alejandri  ·  3Komentar