Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.php > #4399
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Newsgroups | de.comp.lang.php |
| Subject | Re: HTTP Content Streaming |
| Date | 2018-07-15 20:39 +0200 |
| Message-ID | <fr1indFlpftU1@mid.individual.net> (permalink) |
| References | (1 earlier) <fqpmdvF7cb0U6@mid.individual.net> <fqr5npFfia1U1@mid.individual.net> <1t5b486344i3e2cn3e8%sfroehli@Froehlich.Priv.at> <fqsjnfFo6jdU1@mid.individual.net> <1t5b499404id82n3e8%sfroehli@Froehlich.Priv.at> |
Stefan Froehlich:
> On Fri, 13 Jul 2018 23:26:06 Arno Welzel wrote:
>> Stefan Froehlich:
>>> [phpspreadsheet]
>>> Wobei, wo ich gerade darüber nachdenke: man müsste eigentlich
>>> HTML-Templates einlesen und daraus xlsx generieren können. Muss
>>> ich mir einmal ansehen...
>
>> <https://phpspreadsheet.readthedocs.io/en/develop/topics/reading-and-writing-to-file/#html>
>
> Hm:
>
> | Please note that HTML reader is still experimental and does not
> | yet support merged cells or nested tables cleanly
>
> Schade, aber danke für den Hinweis, damit erspare ich mir das
> Ausprobieren.
Wenn Du keine verbundenen Zellen oder verschachtelte Tabellen hast,
sollte das aber kein Problem sein.
Und soooo aufwendig ist das "manuelle" erzeugen einer Tabelle auch nicht:
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Text erste Spalte');
$sheet->setCellValue('B1', 'Text zweie Spalte');
$sheet->setCellValue('A2', 'Text erste Spalte, Zeile 2');
$sheet->setCellValue('B2', 'Text zweite Spalte, Zeile 2');
$sheet->setSelectedCell('A1');
header('Content-Type: application/'.
'vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;'.
'filename="my-file.xlsx"');
header('Cache-Control: max-age=0');
$writer = new Xlsx($spreadsheet);
$writer->save('php://output');
Bei Bedarf kann man auch mit setCellValueExplicit() den Datentyp mit
angeben, wenn man z.B. Datumsangaben oder Zahlen als Text haben will.
--
Arno Welzel
https://arnowelzel.de
https://de-rec-fahrrad.de
http://fahrradzukunft.de
Back to de.comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar
HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-10 19:24 +0200
Re: HTTP Content Streaming k@rl.pflaesterer.de (Karl Pflästerer) - 2018-07-11 00:07 +0200
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-11 08:07 +0200
Re: HTTP Content Streaming k@rl.pflaesterer.de (Karl Pflästerer) - 2018-07-11 12:37 +0200
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-11 19:56 +0200
Re: HTTP Content Streaming k@rl.pflaesterer.de (Karl Pflästerer) - 2018-07-11 21:55 +0200
Re: HTTP Content Streaming "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-07-11 23:32 +0200
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-12 20:29 +0200
Re: HTTP Content Streaming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-07-11 00:28 +0200
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-11 08:06 +0200
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-12 20:53 +0200
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-13 10:21 +0200
Re: HTTP Content Streaming Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2018-07-13 08:33 +0000
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-13 23:26 +0200
Re: HTTP Content Streaming Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2018-07-14 06:12 +0000
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-15 20:39 +0200
Re: HTTP Content Streaming Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2018-07-16 05:47 +0000
Re: HTTP Content Streaming Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2018-07-16 20:48 +0200
Re: HTTP Content Streaming Arno Welzel <usenet@arnowelzel.de> - 2018-07-17 21:21 +0200
Re: HTTP Content Streaming Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2018-07-18 15:26 +0000
csiph-web