PHP
  Home arrow PHP arrow Page 4 - Anatomy of an Output Class
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Anatomy of an Output Class
By: Daryl Houston
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2003-07-16

    Table of Contents:
  • Anatomy of an Output Class
  • PDF Basics
  • Writing PDFs
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Anatomy of an Output Class - Conclusion


    (Page 4 of 4 )

    Generating "spreadsheet" PDFs can be a real hassle, and I sought to relieve myself of that hassle by writing an Output class, which is itself far from perfect. For larger data sets or for PDFs that don't follow the format of a (potentially) multi-page set of rows and columns of data, my class is of limited use. I suspect that a number of the methods I've used to perform certain tasks could be optimized or reworked to be more user-friendly, and I won't release any code until I've had a chance to do that reworking. 

    I offer this summary of my efforts, with particular emphasis on the parts of the class that gave me problems, in hopes that it may be useful to others developing similar pieces of code. My primary flaw was one of design -- I hadn't fully considered some of the problems that might arise before I waded in and developed the first draft of the class. I have attempted here to expose some of the issues that escaped my initial attention and to offer groundwork toward workable solutions for those issues.

    The end result has been very satisfying for me. Where before, the creation of a new PDF report meant copying an old report and spending a few hours doing the tedious work of tweaking widths and positions buried in a couple of thousands of lines of code, I can now copy the above code sample, apply a few tweaks to handle data formatting and building of graphs, and be done with it. 

    Time for development of our routine reports has been reduced significantly, and code maintenance is much easier. The class is currently about 1150 lines. (The graph code itself is about 200 lines.) Of course, that count includes code for the other three types of output as well, along with ample comments. The code is cleaner and much more portable than what we had been using before building the class. With all its headaches and boils and bruises, the Output class has proven most beneficial.

    Note

    In retrospect, this could stand to be changed. The value should always be in the value field instead of crossing over this way.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    PHP ARTICLES

    - Making Usage Statistics in PHP
    - Installing PHP under Windows: Further Config...
    - File Version Management in PHP
    - Statistical View of Data in a Clustered Bar ...
    - Creating a Multi-File Upload Script in PHP
    - Executing Microsoft SQL Server Stored Proced...
    - Code 10x More Efficiently Using Data Access ...
    - A Few Tips for Speeding Up PHP Code
    - The Modular Web Page
    - Quick E-Commerce with PHP and PayPal
    - Regression Testing With JMeter
    - Building an Iterator with PHP
    - PHP Frontend to ImageMagick
    - Using PEAR's mimeDecode Module
    - Incoming Mail and PHP







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway