Home arrow Delphi-Kylix arrow Looking at the Details for an Invoicing Application in Delphi

Looking at the Details for an Invoicing Application in Delphi

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.

Author Info:
By: Chris Neeman
Rating: 5 stars5 stars5 stars5 stars5 stars / 9
July 16, 2007
  1. · Looking at the Details for an Invoicing Application in Delphi
  2. · Settings Unit
  3. · New Invoice Form and Code
  4. · Invoice Management Code and Output
  5. · Client Management Code
  6. · Final output and Conclusion

print this article

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

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);


settings : TINIFile;


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


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


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

  //  showmessage(floattostr(vat));

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





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.

blog comments powered by Disqus

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials