Printing Forms

Hi again!!
I am stuck into a new problem.I have a invoice form with regular fields in it and when the user press the print button, I want to print it out in desired formatting like, company name, address etc. at the top of the page, and so on.
Can anyone (as always) suggest me some simple solution for this??I found lot of examples on google for this which mainly emphasis on PDF format.I dont need to save the form at all but just want to print the form.
Looking forward for answer in anticipation.:slight_smile:

Hi Anita

probably the easiest way would be to give the user a pre prepared print version of the invoice populated from the database and set out as you want it.

You can automatically tell browser to print the window after it has been produced and away you go :slight_smile:

Thx again for your reply spikez.“pre prepared print version of the invoice” may seem easy to you coz u know how to do it.But unfortunately I don’t have a slightest idea about how to do it. :frowning:

It would be a basic template page set up as the invoice form and the information already on it. Are you getting the data from a database or are you printing directly from the form?

Okey you mean to fetch data straight from database and design simple template in HTML?
That sounds relaxing from me coz net is filled with GD library and all that stuff.Yeh I have to save data in database.One more thing.Can you give me idea how can I set auto-incrementable values for invoice number??
Like I101 and so on??

You should have an auto-increment in your database schema so each invoice has a unique number. Trying to do it any other way would be a problem to say the least!
You could do a unique number based on the time() function but thats going to be messy!

Ok I will try this on.Thx a ton :slight_smile: