SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Report generator

    I need a class or script that produces HTML reports from any given array (whether from database or script). I have found a lot of scripts that have everything including the kitchen sink, but what I'm really after is just a class that grabs the array - you tell it what groups to use and the columns and then just have it print out the result.

    Unfortunately the usually reliable PEAR doesn't have such a class.

    Does such an animal exist?

  2. #2
    SitePoint Evangelist superuser2's Avatar
    Join Date
    Aug 2006
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm afraid I don't really grasp what you want this to do. I assume you have seen print_r()

    http://us3.php.net/print_r

    and var_dump()

    http://us3.php.net/var_dump

    Other than that I don't know what you mean by 'reports'. Could you please elaborate?

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Report generators would be familiar to anyone who has used (for an example) Microsoft Access. You have a table that gives you what is essentially an associate array.

    eg

    actor=Reese Witherspoon
    movie=Walk The Line
    year=2005

    actor=Harrison Ford
    movie=Patriot Games
    year=1992

    actor=Harrison Ford
    movie=What Lies Beneath
    year=2000

    actor=Reese Witherspoon
    movie=Cruel Intentions
    year=1999

    In reporting you would then group and sort the data. Say we decided to group by actor and sort by year:

    PHP Code:
    Harrison Ford
    Movie               Year
    Patriot Games    1992
    What Lies Beneath  2000

    Reese Witherspoon
    Movie               Year
    Cruel Intentions 1999
    Walk The Line    2005 
    Most of the php scripts I have seen have been pretty bulky, with the database abstraction written into them, pdf generation, etc.

    I'm thinking of perhaps writing my own class that extends the PEAR HTML_table class. I was just hoping someone knew somewhere the work had been done already.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •