Hi

One more suggestion that does work reasonably well.

Generate a basic HTML page with a table laid out to suit the labels, in php,
with addresses in place
Write the page to your webspace as labels.htm (you will need to set
permissions to allow this)

You then need a program that will open and print HTML pages (From experience
MS Word will, and there will be plenty of others too )

then in your php

<?php
header ("Content-type: application/msword");
header ("Content-Disposition: attachment; filename=report.doc");
include('labels.htm');

?>


The above is for Word, substitute .doc for a file type associated with your
program, or invent one and associate it with your program. Again tested
under Windoze, and I should think it will work under other o/s

The doc will then open in the program, correctly laid out ready for
printing.

No special software, or techiness needed

I only did single pages, might need some playing with to make it work with
multiple pages

Also works for any sort of mailmerge, or reports. I only had it working with
text and table borders. Be interested in anybody trying it and making it
work with images and multiple pages.

HTH


Peter

-----------------------------------------------
Excellence in internet and open source software
-----------------------------------------------
Sunmaia
Birmingham
UK
www.sunmaia.net
tel. 0121-242-1473
International +44-121-242-1473
-----------------------------------------------




-----Original Message-----
From: Landy Atkinson [mailto:[EMAIL PROTECTED]
Sent: 28 May 2003 13:40
To: [EMAIL PROTECTED]
Subject: [My Solution] Re: Mailing Labels from MySQL database on web


Thanks for all the ideas.  Here is a list of the basic paths
suggested along with the comments given for each method.  Nobody
claimed any of these was really good and hoped someone would suggest
a better approach.

1. Use MS Word's mail merge and MS Query with MyODBC as the data source.
     - Only good for Windows & MacOSX and requires fairly high end user
       knowledge to download and install MyODBC and set up MS Query.

2. Use PHP to generate VBScript to control MS Word.
     - Difficult to set up.

3. Use PHP to build a PDF on the server in the proper Avery label format.
     - Nobody suggested a PDF file builder for PHP, but suggested there
       were cgi-scripts available for this purpose.

4. Use one of the reporting packages which can be found at sites like
    freshmeat.net or sourceforge.net, but nobody responding had tried
    this.
     - Nobody suggested a particular package or stated how well this
       might work.

5. Use PHP to create the CSV file and present it as an HTTP
    right-click download link on the web page.
     - This might be a good solution which could work with most
       any word processor.

6. Use PHP to dynamically produce an HTML page formatted to
    work with your labels and print it right from there.
     - Dependent upon which browser and printer is being used, i.e. not
       very device independent.

Number 1 & 5 seemed like the best of what was suggested for my
purposes.  I decided to take path #1 and it seems to work pretty
well.  I've written up instructions for the end user to follow and
will give it a try as soon as I get MySQL permissions straightened
out.  It turns out my ISP sets up only an admin user for the MySQL
database on our site and this user does not have GRANT privileges.
Mailing label printing works fine when MyODBC is set up using the
admin account.  I have a Support Ticket in with my ISP to create a
couple of users with only the necessary privileges.  Once this
happens, I will pass it on the the Club Secretary and see if this is
really a workable solution.

-Landy

>
>----- Original Message -----
>From: "Landy Atkinson" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, May 27, 2003 2:25 PM
>Subject: Mailing Labels from MySQL database on web
>
>
>>  I have a club roster database set up on our web site in which the
>>  underlying data is in a MySQL database.  I am using PHP to access the
>>  data and display it on a web page as a phone list, e-mail list,
>  > directory etc.  Now what I need is to give the club secretary a way
>  > to print mailing labels.
>>
>>  What is the best way to approach this?  As a temporary measure, I
>  > used an auxiliary program (MySQL-Front running on a Windows PC) to
>  > create a CSV file which I e-mailed to the secretary along with
>  > instructions on how to use the file in mail merge document in MS Word
>>  to create labels.  I thought about writing PHP code to create a CSV
>>  formatted output on a web page which the secretary could copy and
>>  paste into a document for the mail merge, but it seems there should
>>  be a better way.
>>
>>  Any suggestions?
>>
>>  -Landy
>>
>>  --
>>  MySQL General Mailing List
>>  For list archives: http://lists.mysql.com/mysql
>>  To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>>
>>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to