Why do I always think of really cool projects when I have absolutely no time to work on them?
I'll leave that conundrum for another night. For now, I'll document an idea I came up with that would save me, and undoubtedly many other PHP coders, a great deal of time. I think it would be incredibly helpful to have a class that could be passed a minimal number of parameters and it would generate a nicely formatted report.
Someone has built a
rudimentary report generator already, which is freely available online. The problem is that it is far too basic in its current form. Here is a list of the features my report generator (if it ever comes to fruition) should have:
- Accept a mysql recordset as a data source
- Allow me to specify my own column headings if the field labels in the recordset are too cryptic
- Let me specify any number of font, color, spacing and alignment properties
- Let me dynamically assign styles depending on certain criteria in the data (e.g. if ID is missing, text is red)
- Easily set pagination properties (number of records to show per page)
- Allow end user or programmatic sorting and filtering of ANY or ALL columns
- Provide buttons to allow the user to export a PDF or CSV file from the data
- Allow end user to create a "printer friendly" version of the report
I don't think I'm asking for too much. I do think that if I ever sat down and created this, that many people would find it helpful, and a great time-saver. If anyone wants to urge me to actually tackle this project, feel free to
drop me an email.
Posted under the influence of [[Death Cab For Cutie :: We Looked Like Giants]]