Delphi-Kylix
  Home arrow Delphi-Kylix arrow Looking at the Details for an Invoicing Ap...
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  
Download TestComplete 
IBM® developerWorks 
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? 
DELPHI-KYLIX

Looking at the Details for an Invoicing Application in Delphi
By: Chris Neeman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2007-07-16

    Table of Contents:
  • Looking at the Details for an Invoicing Application in Delphi
  • Settings Unit
  • New Invoice Form and Code
  • Invoice Management Code and Output
  • Client Management Code
  • Final output and 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

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Looking at the Details for an Invoicing Application in Delphi
    (Page 1 of 6 )

    In the previous article we discussed the requirements and purpose of the invoicing application that we are creating. We also listed the main application code. In this part of the article we are going to look at how to connect the database that we created earlier to the application code. We will also look at some of the code in detail.
    A downloadable .rar file is available for this article.

    How the application works

    The invoice application works by storing and retrieving its information in the database that we created earlier.  When the application is first started, it loads certain application-specific settings from an ini file. See the code below:

    procedure TForm1.FormCreate(Sender: TObject);

    var

    settings : TINIFile;

    begin

    settings := TINIFile.Create(ExtractFilePath(Application.EXEName) + 'settings.ini');

      try

    con:=settings.ReadString('Settings', 'con','');

      //showmessage(con);

    vat:=settings.ReadFloat('Settings', 'vat',8.5);

      //  showmessage(floattostr(vat));

    rav:=settings.ReadString('Settings', 'rav','');

       finally

       settings.Free;

       end;

        end;

    The code shows the oncreate event of the first form in the application. This code loads the following information:

    • con – This string contains the path to the database and will be used throughout the application to connect to the database tables.
    • vat - This is the VAT rate that the application will use when it calculates the totals.
    • rav – This variable stores the path to the rave report file that contains the output designs of the invoice.

    This method of storing and retrieving data increases the application’s portability. You can change these values in the ini file by clicking on the settings menu item, which will bring up a window for you to set new values. The next page has a screen shot of what that form looks like and also the code listing for the settings unit.

    More Delphi-Kylix Articles
    More By Chris Neeman


     

    DELPHI-KYLIX ARTICLES

    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...
    - Using the Client Dataset in File-Based Archi...
    - Demystifying the Client Dataset
    - Working with INI Files in Delphi
    - Creating Data Link (UDL) Files in Delphi
    - Looking at the Details for an Invoicing Appl...
    - Invoicing in Delphi: Show Me the Money
    - Saving Images and Binary Files to a Database...
    - Saving Files to a Database using Delphi: Sav...
    - Creating CF Applications and Integrating a S...
    - Using Try and Finally to Help Prevent Memory...
    - The Implementation of an FTP Server
    - FTP Server: The Theory






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