I think that reporting in PHP is very hard. I tried the raw methods of FPdf or R&OS but i would like to know if there is something more friendly to use like JasperReport or Adobe LiveCycle.
I saw somewhere the php javabridge to run jasperreport from php, but i don't like very much this solution.
What do you use for php reporting? Don't you think that fPdf or smiliar are not very friendly for standard reports?
Thank you.
Personally I use PHPExcel for creating Excel files and TCPDF for PDF. Both are very well written object oriented libraries and don't need any external extensions.
What do you mean by php reporting?
For generating PDF files I use and highly recommend mPDF, which does not require any special extensions on the server.
Related
I've been looking around for a good HTML to PDF converter via PHP. But all the information I've gathered is from 2010 or earlier which gives distorted image in my opinion because ever since those libraries were made or used or whatever, HTML5 and CSS3 wasn't in the picture yet. So now I'm wondering which library is nowadays still working flawless and is worth trying out.
I've found a couple of libraries and I was wondering if these are good enough these days but if you have another example, library or script. Please do tell
DOMPDF
mPDF
fPDF (don't think this one is an option but I've seen a lot of scripts using fPDF as foundation)
HTML2PDF and HTML2PS
Thanks in advance!
You might want to try using phantomjs headless browser with some PHP library of your choice.
How do I generate PDF files with PHP. php.net says that pdflib needs to be installed to use functions such as new_pdf ().
However, pdflib is not free and the lite version is not allowed for commercial use. I am confused. I would have thought PHP would have some built-in functionality to create PDF files.
How do I get through this as I do not want to use libraries such as fpdf, etc.?
You should try the following. They are some useful PHP libraries for PDF documents:
TCPDF
mPDF
DOM PDF
See Stack Overflow questions Generate PDF from HTML PHP and How to generate PDF files with PHP?.
It's your choice with which you feel more comfortable.
PHP does not have any in-built functions, so you have to use libraries. TCPDF is the easiest modules and it's free.
If you don't want to use pdflib, you will have to use another third-party library.
Zend provides one as part of the Zend Framework. But the ones we have used for various purposes are:
DomPDF is great for taking HTML and producing PDF files
tcPDF is a more class-based drawing style approach, but it works great and gives loads of control.
i am building a simple system using PHP that allow people to Add, Delete, and View data.
Can anyone tell me how to view the uploaded data in PDF format?
There are a bunch of options. The ones I like are:
wkhtml2pdf - A command-line tool that uses the WebKit HTML rendering engine to generate PDFs from HTML docs. Very easy to use, assuming you're able to get it installed on your server, and your requirements aren't too stringent. You just generate HTML/CSS, and use PHP's shell-exec functions to run it, and voila.
Zend_Pdf - Part of the Zend Framework, but like almost all ZF components, you can use it stand-alone. Programmatically build PDFs.
tcpdf, fpdf (with fpdi if you want to import existing PDFs and write over the top of them) - older, uglier, but effective.
There's also the commercial PDFLib, which used to be the best thing around, but I don't remember much about it. Included for approximate completeness.
Take a look at PDFLib, or its deprecated predecessor.
I'm faced with having to generate some fairly basic PDFs on a server which is running php 4.3.2 unfortunately.
So that pretty much renders most things impossible such as google's domPDF etc.. PDFlib is not compiled in so I can't use any of that either.
Does anyone have any suggestions?
Thanks!
use this R&OS PDF Class to achieve this task.. This is fairly simple and light weight class and requires no module etc to be installed on the server.
You could try out DocRaptor.com, which is a webservice that will let you convert html to pdf.
I ended up using an older version of fpdf and HTML2PDF (from the link below.) It's certainly not ideal, but then neither is a 7 year old version of php.
http://www.macronimous.com/resources/Converting_HTML2PDF_using_PHP.asp
You didn't mention if you were generating these from scratch or from existing PDF data. pdftk is a handy PDF manipulation library. You can shell out to it from PHP.
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