Click here to Skip to main content
Email Password   helpLost your password?

img53.JPG

img059.JPG

img058.JPG

img057.JPG

Introduction

This ActiveX control is a powerful tool to help you create and print invoices as Data Report. Now you can preview and print invoices by one touch. This ActiveX control has two versions, one to use in the English language (its name is "EInvoice" and another to use in the Arabic language (its name is "AInvoice"). The two controls are the same when using its properties and methods.

You use this ActiveX control in your application by adding it to a form and setting its properties. At design time, my ActiveX control is displayed as an icon on a form, this icon can't be sized. The control is invisible to the user at run time (as CommonDialog control and Timer control).

With my ActiveX, you can:

Background

My ActiveX "Invoice Designer" EInvoice or AInvoice depends on table's name and field's name as shown in the following table:

Table name Field name
Orders OrderID
CustomerID
EmployeeID
OrderDate
RequiredDate
Freight

Customers

CustomerID
CompanyName
City
Phone
Employees EmployeeID
FirstName
LastName
Products ProductID
ProductName
Order Details OrderID
ProductID
UnitPrice
Quantity
Discount

So, if you build a new database file and want to use my ActiveX control, be sure that your database file includes tables with the same name and your tables include fields which have the same name as you see in the above table.

Don't worry I don't tie your hand, of course you can add other tables and other fields to your database file but you must keep to the table's name and the field's name as given in the above table.

My ActiveX control has one method and twenty one properties. You can read about the method and two properties in the following table. The other properties are in the help file after you download and extract the file "Invoice.zip".
 

Method/Property Definition Example
ViewInvoice Display invoice (order by customer name) EInvoice1.ViewInvoice (in English) or,
AInvoice1.ViewInvoice (in Arabic)
InvoiceDatabaseFile Set path and name of database file EInvoice1.InvoiceDatabaseFile = App.Path + "\" + "MyMarket.mdb"
InvoiceTitle Set the title of invoice EInvoice1.InvoiceTitle = "International Food Company"

Using the Code

After you set some properties, you can display the invoice:

EInvoice1.ViewInvoice ' if using "EInvoice" control for English language.
AInvoice1.ViewInvoice ' if using "AInvoice" control for Arabic language.

Remarks

After you download the file Invoice.zip and extract it, you find:

Last Words

I hope my ActiveX is useful. This tool is for personal use only and not for public use, you can use it for your own projects. Thanks to The Code Project and thanks to all.

History

Mostafa Kaisoun
M_Kaisoun@hotmail.com

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralMy vote of 1
Syed Javed
19:50 11 Jan '10  
poor
Questionsource code of acivex controls
Avinash Sureka
23:32 7 Jun '09  
sir could you please send me the source code of the activex controls u have posted as i need to learn how to make such controls with ease. I m a free lancer and a student. It will be of very kind if u send me at earliest on my emai id indcomp07@gmail.com.
GeneralError
Tabitutza
0:01 23 Apr '09  
I run your project using the given database (without modifying anything) - MyMarket.mdf. But the following error appears:

Some Tables in your database file are not compatible, or some Fields in this Tables are not compatible, the application can't continue.

Any ideas, please?

Thanks!

Tabitha

GeneralRe: Error
Mostafa Kaisoun
3:13 24 Apr '09  
I test the application with the file (MyMarket.mdb), no errors.
I test the application with the file (Northwind.mdb), no errors.
Perhaps you change the name of any table or change the name of any fields.
Please download the file (Invoice.zip) again then test the application with (MyMarket.mdb) or

(Northwind.mdb).
Thanks,
M. Kaisoun


Last Updated 20 Mar 2009 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010