Solved

Producing multi-page pdf or excel table-formatted report from PHP/MySQL on the fly

Posted on 2011-09-17
6
861 Views
Last Modified: 2012-05-12
I have to produce a fairly large (50ish page) report of analytical data in table format from a PHP/MySQL app on the fly. Can anyone recommend a good solution?

I've looked at fpdf, but I'm unsure about how to manage formatting of the table and page-breaks. With PHPExcel I'm concerned about available memory. Dom2pdf I've just started looking at, but I'm not sure if it's the right solution.

I guess I'm just looking for some ideas and best-practices.
0
Comment
Question by:dirknibleck
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 36555195
I would use FPDF; it has been my friend on many occasions.  But that said, you have a lot of work ahead of you, no matter which solution you choose.  It is different to use HTML which is a markup language, vs PDF which is a layout language.  If you want to use a layout language to facilitate printing you need to think about layout instead of semantic markup.

Let's try this... Create a small one-or-two page "temporary table" PHP and MySQL app that writes the output to the browser.  Then show us how that output should be written to the report of analytical data.  Maybe we can show you a design pattern that would work with FPDF or a similar technology.
0
 
LVL 9

Expert Comment

by:ghodder
ID: 36555364
Have you looked at TCPDF? It was originally forked from fpdf and has a lot more features which may or may not make your life easier including the ability to convert HTML+CSS into PDF pages.
0
 
LVL 15

Accepted Solution

by:
dirknibleck earned 0 total points
ID: 36596762
Ultimately, I've decided to go ahead with dom2pdf. It's working pretty well. The biggest issue I have is that it is blowing through memory like crazy, so I've had to split the job to create multiple files which I will now stitch together into one pdf document.

Thanks for your suggestions though.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 15

Author Closing Comment

by:dirknibleck
ID: 36890353
Time constraints led me to take a bet on a quick solution. It seems to have worked out for me.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 36598348
Let's see... We asked you for some test data.  What did we get?  No test data, and your choice is "blowing through memory like crazy?"  Is this really a solution?
0
 
LVL 15

Author Comment

by:dirknibleck
ID: 36598989
I asked for ideas and best-practices. What did I get? A request for data and suggestions of plug-ins.

I truly appreciate that you took the time to answer, but you didn't really maintain the direction of this question and my time constraints didn't offer me the opportunity to engage your path.

Ultimately I have a solution that works for my immediate needs and no time to pursue a better offering. I suppose I could have opted to simply delete the question. I'm open to that if the moderators prefer.
0

Featured Post

Webinar: MariaDB® Server 10.2: The Complete Guide

Join Percona’s Chief Evangelist, Colin Charles as he presents MariaDB Server 10.2: The Complete Guide on Tuesday, June 27, 2017 at 7:00 am PDT / 10:00 am EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question