PDA

View Full Version : Printing invoices


hairsoup
25th December 2005, 21:45
Need a bit of advice from the programmers among us.

The current system used for printing invoices is printing a html one from internet explorer on a secure part of our site.

This is a bit tedious as only one can be done at a time, with repetitive tasks like back button -> click -> ctrl+p -> enter -> back -> click and such.

Also want to get a label printer for addresses packages.

The best solution I can come up with is an executable application, which fetches the order information from the website database [hosted elsewhere], presumably the best way to deliver this information is with XML. Then a button is pressed to batch print invoices for all new orders. And another button for printing addresses onto labels with a special label printer.

I currently have Visual Basic 6 and have a fair knowledge of it.
However I lack knowledge of the following:

How to fetch a file from the internet.
How to parse xml in VB
How to batch print, Ive used the data report designer before, but its quite nasty, so id rather use an alternative.
Not sure if printing stuff with a label printer is any different to a4 invoices, but i suspect it may have complications.


I find it hard to find out this stuff on the net as a lot of things are now to do with this '.net' lark, which I haven't bothered with, and I havent a clue what its about. Is it much different from my humble VB6? Is there much of a learning curve to it?

Thanks in advance.

DarrenC
25th December 2005, 21:47
It all seems a little complicated just to print an invoice. I have an access database (offline) which stores client data.

I run a mailmerge in MS Word, and it displays all the invoices for a specific period, click on print and sorted. Same goes with the labels, data from database, mailmerge into MS word and click on print..

Done in 5 mins max.

hairsoup
25th December 2005, 23:10
Problem is my database is not on my computer.

DarrenC
26th December 2005, 06:33
All of my data is held on an online mysql database, I just export it to a .txt file and import it into my access database. Really does take 2 mins..

hairsoup
26th December 2005, 08:41
Not sure it will work for me. The first thing I tried was a mail merge from a csv file, but the problem with it, and this is where I suspect our two systems differ, as a retailer I need to itemise the full order for everything that has been purchased, so I tried to use multiple data sourcces in a document, but it seems that isnt possible, I can think of ways to do it with one, but other reasons for a neat and tidy program are below:

My staff have little technical knowledge and while it would be little effort to show them how to do it theres a chance they will fluff it.

I need to show images on the invoice, which need to be fetched from the website. This is something I forgot to mention in my first post.

And also, my staff will need to reprint a particular invoice or label. So I doubt mail merge will help there.

Thanks for the input, if my ambitious solution doesnt come off I'll probably end up looking at mail merge again.

DuaneJackson
28th December 2005, 13:50
You might be able to get Access to use data from your online database is you can set up a DSN and use "link tables".

I have code somehwere for grabbing http content in VB, I'll see if I can find it for you - there are numerous methods. You might want to look at cshttpclient from www.coalesys.com - it's a free component.

The best solution would be to do this using a server side language to access the database and generate the invoices and labels as pdf files (See www.fpdf.org)

I've done this recently for a client using an e-commerce system we created for them.

hairsoup
28th December 2005, 14:46
Thanks Duane, PDF might be a good solution, I'll look into it further.

XML parsing and printing stuff in VB are my biggest knowledge gaps.

DuaneJackson
28th December 2005, 14:57
I wouldn't even go down the printing route in VB, stick with PDFs, even if you create and print them from within VB.

For XML parsing I think you need to look at SOAP, although I may be wrong - a few other members know more about this than me.

crus
28th December 2005, 14:59
Defo go PDF,

Had a mobile phone accessory site a couple of years ago,
each day at the start of packing process, say lunchtime, a batch of all invoices to that date was created as a single PDF (really easy in PHP) along with labels. This was then printed, picked and sent. The system could easily continue to take orders asanything after 12 pm was not processed and anything before (unflagged) was.

For more go to PHP.net and then pdf, similar stuff in asp but PHP is FREE and Better?

D

hairsoup
28th December 2005, 20:25
Im familiar with both languages, but havent worked with php in a year or so.

Just digged out my old manual... has a nice reference to something called ClibPDF.

Thanks for the advice Duane and Crus. Im off to php.net to check if ClibPDF still exists!

hairsoup
28th December 2005, 23:00
Well, my host doesnt support the pdf stuff, so I wont be able to do them with php, perhaps xml to vb app that then does the pdf.