-1

I want export php web page to excel below page.

http://opendcim.org/demo/rowview.php?row=1

That site ID is "dcim" password is "dcim".

I want make same table in xls.

I want make this view in xls

How can export to xls?

thank you

ZXC
  • 9
  • 4
  • And you have tried what? You DO need to make an effort to solve the problem yourself. If you can't bother, why should we? This isn't some free coding service. – M. Eriksson Nov 03 '16 at 08:00
  • You should probably take a look at this answer : [enter link description here](http://stackoverflow.com/questions/12541000/how-to-export-html-table-to-excel-or-pdf-in-php) – tchartron Nov 03 '16 at 08:02
  • Yeah https://github.com/PHPOffice/PHPExcel should do this. Read the docs, there will be everything you need. – CodeBrauer Nov 03 '16 at 08:49

1 Answers1

0

sorry. because you seems never tried before ask. i will only give you the way not the code.

i agree with magnus that this is not web free coding services. i hope you understand.

create excel from html table have 2 ways.

  1. use php header above your variable table then echo it into browser

    header("Content-Type: application/vnd.ms-excel; charset=utf-8");

    header("Content-Disposition: attachment; filename=table.xls");

    echo "YOUR TABLE";

this is the simple/fast way. but its only support ms.excel 2003. If you trying to open table.xls, ms.excel will throw you into web display menu not normal display menu. and you will get warning from ms.excel that your format may be cant read (i forgot what the warning content actually)

  1. use library.

i recommend to use phpexcel from codeplex. this library support ms.excel 2007 (both .xlx and .xlsx). if you open your excel, ms.excel will bring you to normal display view like normal excel, you will not get any warning like above and you can use special feature in ms.excel like chart, filter ,etc. but your excel creating process will not simple as above, you need to read the documentation first.

plonknimbuzz
  • 2,594
  • 2
  • 19
  • 31