Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4110042
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:52:57+00:00 2026-05-20T21:52:57+00:00

I’m looking for recommendations on how to do some reporting in PHP. Specifically, I

  • 0

I’m looking for recommendations on how to do some reporting in PHP. Specifically, I need PDF rendering and I would like to separate the presentation from my code as much as possible (templates of some sort?).

I’ve recently received a PHP4 code-base on the job and am in charge of upgrading to PHP5. The reports currently are created via TCPDF which are driven from HTML generated straight from PHP. The upgrade process is proving extremely challenging. I’m running into multiple problems with TCPDF where it will just go into an infinite loop and never return. Through some troubleshooting and forum posts, it appears we’re doing some stuff that TCPDF4 with PHP4 didn’t have a problem with but TCPDF5 and PHP5 does. Unfortunately, rather than error on whatever rules we’re breaking, I just get infinite hangs. Our in-house code could use some refactoring and I feel a re-write could mitigate many of these problems, however I’m not opposed to looking beyond TCPDF right now.

Our code also has a lot of the HTML generation mixed in with the rest of the reporting features. I would really like to separate this out so that little to no PHP code is required when editing or creating a report. I don’t need anything too fancy for the report. Needs to support basic data tables and multiple horizontal panes on a single tab. There are charts but they are currently generated by a separate package and just read directly as an image. Suggestions on the best way to re-do these reports? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:52:58+00:00Added an answer on May 20, 2026 at 9:52 pm

    You can use PHP as a template engine, and than you can convert the HTML output to a PDF.

    Here are the options for PHP templating:

    • Use Smarty, it’s pretty easy and has it’s own template language, but I think that it’s for your usages a bit overhad.
    • Or you can use just plain PHP, just put the templates code into a sepearated directory and create a function render_template('template_name.php') or something like this.

    In your case, I think that you could write your own class for the handling of reports. Here just a simple sketch of the usage:

    <?php
     $report = new Report(1234);    // report id
     $report->template = 'default'; // or something different
     $report->addField('Users', array('Claire', 'Fred', 'Kevin'), array('renderArray' => true));
     $report->addField('Note', '<p>This report was generated automatically.');
    

    So, eventually you can use some of the simple ideas behind this simple sketch.

    I hope that I understood your question correctly, and that I could help you with this answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have some data like this: 1 2 3 4 5 9 2 6
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.