php export excel file - php

I am woking on exporting datas to excel file from mysql.I google some docs and finally I choose the PHPExcel,it works well and I can successfully complete my work.
but when I upload my code to the online server,it display an error which is "XMLWriter is not found",I also google for this and I know it because the installed php isn't compiled with the class "XMLWriter ",but the question is I have no privilege to recompile the php source.
so if there is other open source class that is used to export data to excel file?
I hope I describe my question clearly.

If you can avoid using PHPExcel, have a look at this tutorial for a plain and simple solution, it might help.
Since you have no control on your PHP installation, I strongly suggest you to abandon PHPExcel, as your PHP version does not include the needed libraries for this package and you don't want to go though painful hacks to make it work somehow...

Related

Read openstreetmap PBF file with PHP?

I downloaded a mbtiles file from this location:
https://openmaptiles.com/downloads/europe/netherlands/
I can serve this file in PHP with this library : https://github.com/klokantech/tileserver-php
This returns a compressed PBF, which Mapbox GL JS can use, but I'm not able in PHP to decode this data to get information out of it.
Has anybody ever extracted data from PBF using PHP ?
I know that this thread is a little bit old right now, but I will answer this anyway in case someone bumps into this issue.
You can use package named osm-pbf, for reading PBF files using PHP. As far as I know, it is currently the only option if you want to use PHP.
Link to package: https://github.com/franksierra/osm-pbf
Installation is fairly easy, you can just use composer.
The library itself is pretty slow, it takes around 8 minutes to read 300MB PBF file, but for smaller files it works like a charm.

working with php and python together

currently i am working on a project which is related to automation.
I am using php and mysql for my work. I have to make a code in php which can import, export and edit the excel file and the extension of excel file is .xlsm. As i have tried my best, but i didn't succeed with the .xlsm file.
so, one of my friend has suggest me that in python, you can do that.
so, is it possible, if i insert the python script(which can import, export and edit the .xlsm file) into the php code and the run the code. please let me know, will this work. if this work then how?
You can use exec() to execute an external program in PHP.

Export Moodle report in csv file

Does anyone know any Moodle built in feature to export custom report into a csv file?
I've tried to find in documentation but there is nothing. There's this old book which also have no practical information on exporting report into a csv file.
I've tried to dig into the source code and also in Moodle's administration block. You can export log reports as a csv file. So I'm sure there has to be something.
If anyone can help me with this that would be great help!
Thanks,
Mac
You need a plugin to do this, try one of these:
https://moodle.org/plugins/view/report_customsql
https://moodle.org/plugins/view/block_configurable_reports
If your're wanting to write code to do this, then take a look at lib/csvlib.class.php - that is a helpful wrapper for the standard PHP csv functions.

I want to write multiple images to an odt file either in python or php

I want to write multiple image files to a odt file. I will be specifying a dir and the script will take it from there thru a loop. But where do i start? I have never done anything like this before!
I found this python code, which can convert html 2 python... so we can parse an html first and then call this one. But there is no reference on how to use this.
html2odt code
Atlast I found a PHP way to write odt direct! Its well documented.
http://www.odtphp.com/
I have also written a complete practical solution in php. You can upload multiple images and get the odt document generated.
The code is hosted at http://code.google.com/p/images2odt/
The first post is done here.
For anyone wanting to use the Python code will need a Python interpreter version 2.6. It might also work with version 2.7. It's mainly used in Linux but there are Windows and Mac versions as well. You will also need the files listed in the from and import statements. These files are in some of the other folders. It looks like it is a part of a much bigger Linux package. One last thing, Python scripts usually takes their arguments from a command line.
Additional info:
I looked over the setup.py file and it told me that this is an API library for open documents called odfpy. The version is 0.9.2. The link it has for the documentation is broken. A google search for odfpy came up with a place to download a more recent version (0.9.4) in a tarbell here:
http://pypi.python.org/pypi/odfpy
The documentation can be found here in an Open Office document:
https://joinup.ec.europa.eu/software/odfpy/document/api-odfpyodt

Open source PHP reporting tool

I am developing web based application, i need php reporting lib/class to make the job easy.
I need PDF/Excel format. The report based on related db tables(member bills, member info) Is there any advanced open source solution ?
Thanks
There are tons of reporting libraries, most of which create Xml or Csv. You would have to give more data about what kind of reporting you need for a recommendation. I haven't used PHPExcel yet, but it is the first attempt I have seen to actually create Excel documents rather than creating CSV's that will load in Excel. PDF creation is built into PHP with the PDF functions, and is fairly easy to do.
[UPDATE]
PHPExcel is archived now you can use PhpSpreadsheet instead.
A newer library that looks very promising is PHP Reports by jdorn on github.
This is unrelated to the older library by the same name hosted on Sourceforge.
A bit late, but you might want to check out RLib - works with PHP and MySQL and creates multiple different types - PDF, CSV, HTML etc.
http://rlib.sicompos.com/
Unfortunately I don't know of a decent reporting class in PHP.
Do you need a full reporting suite, or do you just need to be able to export data to the pdf and Excel file formats?
If you only need to create these kind of pages, the simplest solution would be to display the data you require and add CutePdf software which installs itself as a printer. Then you can print to pdf from the browser.
If you need to create pdf files on the server side, there is a pdf creation library in the Zend Framework. ZendFramework-1.8.1\library\Zend\Pdf

Categories