Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Printing Address Labels From Mysql


  • Please log in to reply
3 replies to this topic

#1 rolf

rolf

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 675 posts
  • Location:Suffolk UK

Posted 03 August 2009 - 08:05 AM

I've been looking at how best to create address labels from the data in a mysql database and have done a couple of tests with php outputting csvs and some other stuff, and it seems like (with a bit of fiddling about to get it just right) that's probably going to work - however it has suddenly hit me that I may be going about it all wrong and maybe there's a simple way to print directly from mysql - anyone ever done that? can you share any info or point me toward any resources?

Thanks in advance.

#2 1dmf

1dmf

    Keep Asking, Keep Questioning, Keep Learning

  • Active Members
  • PipPipPipPipPipPipPip
  • 2,167 posts
  • Location:Worthing - England

Posted 03 August 2009 - 08:13 AM

AFAIK there is no way to print data direct from DB's.

There has to be a report or other 'merge' done to a document that is then printed.

There are many ways to skin this particular cat, but it all depends on what platform the end result is to be printed on, are you trying to print from a web browser?

Are you generating some form of postscript file, the way we do it is to use MS Office and use MS Access as a front end for staff and use VBA to code the data selection and mailmerge it with MS Word.

It also depends on what type of printer you are using, is it a label printer, is it A4 through a normal laser printer (which is what we have).

a single label printer would be easy to produce a simple textfile and print, the printer may even have some form of 'Markup' language specificaly for creating templates and merging data.


#3 rolf

rolf

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 675 posts
  • Location:Suffolk UK

Posted 04 August 2009 - 07:18 AM

I'm printing to a tractor fed label roll on an Epson LX+300+II (dot matrix- old school!!)

The source of data will be the matching results from a search of the database, formatted into a table on a web page. Ideally I'd like to be able to hit the 'p' key and print address labels for each of the results, so my first approach has been to use JS open a new page with the addresses formatted for printing, and with the the print() command sent by JS as the page loads (also been trying to remove the dialogue box from this stage, but that's for another thread!)

I'm definitely interested to hear more about printing to/from a file if this can be automated - where would I find out about a markup language for that specific printer?

#4 1dmf

1dmf

    Keep Asking, Keep Questioning, Keep Learning

  • Active Members
  • PipPipPipPipPipPipPip
  • 2,167 posts
  • Location:Worthing - England

Posted 04 August 2009 - 07:48 AM

well on quick googling i found this.. http://www.linuxprin...on-LX-300plusII

they seem to indicate that it is a postscript printer, so PostScript files if you have the technology to create these files would work.

And there is a note saying it doesn't suport PJL (Printer Job Language) so it knocks that possibility on its head!

Printing from a browser is notoriously a pain in the butt, because webpages have no concept of paper types / sizes and the margins are controlled via the users 'page setup' not by the print job.

so can you do this server side?

Create a postscript file (out of my league for direct coding help i'm afraid) and then print direct from server side?

perhaps create an RTF file and print.

As for the js print(), you canot print it without a dialog window, its part of the browser security else a web page could just start chucking crap out of peoples printers!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

We are now a read-only forum.
 
No new posts or registrations allowed.