[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== Mailing labels - an easy solution (OpenInsight 32-bit Specific) ====
=== At 29 JUL 2003 05:03:10PM Jim Eagan wrote: ===
{{tag>"OpenInsight 32-bit Specific"}}
I've been trying to get a plain, dirt simple mailing label list.
Designed one in Reporter and it runs fine there but won't run from
a Basic+ prog. There are many complicated threads herein about why
that is but, gee, there ought to be a simple way to do a simple task.
Anyone able to share such? Thank you.
----
=== At 29 JUL 2003 07:22PM Don Miller - C3 Inc. wrote: ===
Hate to tell you, but my simple solution was to export the data to a Word Mail-Merge file. That way, the user can define the label size, type, and a lot of easy to do things, including sorting, etc. Much easier than trying to do it in OI. Works like a charm.
Don M.
----
=== At 29 JUL 2003 11:46PM Richard Hunt wrote: ===
Jim,
I was wondering... what seems to be the problem? Can you give some clues on what is causing your problems? I do not seem to have problems printing on preprinted forms. And well maybe that is because I have some control over what and how the forms are designed.
----
=== At 31 JUL 2003 10:35AM Jim Eagan wrote: ===
Don , 2 things - 1. How do you "EXPORT" since that very nice function does not seem to exist in OI; 2. I'm dealing with users who are VERY
unsophisticated. Thanks for your help
----
=== At 31 JUL 2003 10:43AM Jim Eagan wrote: ===
Richard, I'm unclear what was unclear about my post but, the essence is that it is VERY difficult to run Reporter because Oengine is busy counting the clouds or something. I haven't found any other tool within OI that can do a standard label structure. OIPI might do it but, it looks very difficult also. Vintage 1930's tabulating machines could print labels more easily then what I've come across so far. All help MUCH appreciated.
----
=== At 31 JUL 2003 12:51PM Don Miller wrote: ===
Well, here's a snippet of the actual code that writes the data out to a user-selected output file:
BYTE.POS is initialized to 0 and is incrmented for each write
FVAR is a variable initialized with an OSOPEN statement and points to the user-selected filename
* first create a header for the data to follow:
* CREATE HEADER FIELDS for Microsoft Word Mail Merge
REC="PATIENT NAME","ADDRESS","CITY","STATE","ZIP"':CRLF
OSBWRITE REC ON FVAR AT BYTE.POS ;* WRITE TO FILE
IF STATUS() THEN GOTO WRITE.ERROR
BYTE.POS+=LEN(REC) ;* INCREMENT OFFSET
* BREAK OUT FIELDS - Dict calls are easier
PATNAME={PAT_NAME}
PATNAME=FMT(PATNAME,"L#35") ;* GET BLANKS @ ID OUT
PATNAME=TRIM(PATNAME)
PATADDR={ADDRESS}
PATCITY={CITY}
PATST ={ST}
PATZIP ={ZIP}
REC='
IF LEN(PATNAME) THEN
IF LEN(PATADDR) THEN
IF LEN(PATCITY) THEN
IF LEN(PATST) THEN
IF LEN(PATZIP) THEN
REC:=QUOTE(PATNAME):",":QUOTE(PATADDR):",":QUOTE(PATCITY):",":QUOTE(PATST):",":QUOTE(PATZIP):CRLF
END
END
END
END
END
IF LEN(REC)=0 THEN GOTO READRECORD
* WRITE THE OUTPUT RECORD
FOOBAR=MOD(BYTE.POS,65536)
IF FOOBAR=21930 THEN
BYTE.POS-=1
OSBREAD BYTE FROM FVAR AT BYTE.POS LENGTH 1
REC=BYTE:REC
END
OSBWRITE REC ON FVAR AT BYTE.POS ;* WRITE TO FILE
IF STATUS() THEN GOTO WRITE.ERROR
BYTE.POS+=LEN(REC) ;* INCREMENT OFFSET GOTO READRECORD
It's pretty easy .. uses a Gasbar to measure progress. The user is offered a variety of sorting / selection options which ultimately results in a resolved Select List which is processed in a READNEXT loop.
HTH
Don M.
----
=== At 31 JUL 2003 01:47PM Jim Eagan wrote: ===
Thanks Don! I got lost in being annoyed and didn't put my brain in gear. That is indeed a nice simple solution. Thanks again. Jim
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=6A1C2B576B7BA9E785256D720073A5A0|View this thread on the forum...]]