Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Label Report

Status
Not open for further replies.

Smoky

Technical User
Apr 14, 2001
1
CA
I have created a screen with the wizard and now want to change the print procedure to print a label report. The procedure is as follows;

PROCEDURE printrec
PRIVATE sOldError,wizfname,saverec,savearea,tmpcurs,tmpstr
PRIVATE prnt_btn,p_recs,p_output,pr_out,pr_record
STORE 1 TO p_recs,p_output
STORE 0 TO prnt_btn
STORE RECNO() TO saverec
m.sOldError=ON('error')
DO pdialog
IF m.prnt_btn = 2
RETURN
ENDIF
IF !FILE(ALIAS()+'.FRX')
m.wizfname=SYS(2004)+'WIZARDS\'+'WIZARD.APP'
IF !FILE(m.wizfname)
ON ERROR *
m.wizfname=LOCFILE('WIZARD.APP','APP',C_LOCWIZ)
ON ERROR &sOldError
IF !'WIZARD.APP'$UPPER(m.wizfname)
WAIT WINDOW C_NOWIZ
RETURN
ENDIF
ENDIF
WAIT WINDOW C_MAKEREPO NOWAIT
m.savearea=SELECT()
m.tmpcurs='_'+LEFT(SYS(3),7)
CREATE CURSOR (m.tmpcurs) (comment m)
m.tmpstr = '* LAYOUT = COLUMNAR'+CHR(13)+CHR(10)
INSERT INTO (m.tmpcurs) VALUES(m.tmpstr)
SELECT (m.savearea)
DO (m.wizfname) WITH '','WZ_QREPO','NOSCRN/CREATE',ALIAS(),m.tmpcurs
USE IN (m.tmpcurs)
WAIT CLEAR
IF !FILE(ALIAS()+'.FRX') &&wizard could not create report
WAIT WINDOW C_NOREPO
RETURN
ENDIF
ENDIF

m.pr_out=IIF(m.p_output=1,'TO PRINT NOCONSOLE','PREVIEW')
m.pr_record=IIF(m.p_recs=1,'NEXT 1','ALL')
REPORT FORM (ALIAS()) &pr_out &pr_record
GO m.saverec
RETURN

PROCEDURE pdialog
DEFINE WINDOW _qjn12zbvh ;
AT 0.000, 0.000 ;
SIZE 13.231,54.800 ;
TITLE "Microsoft FoxPro" ;
FONT "MS Sans Serif", 8 ;
FLOAT NOCLOSE MINIMIZE SYSTEM
MOVE WINDOW _qjn12zbvh CENTER
ACTIVATE WINDOW _qjn12zbvh NOSHOW
@ 2.846,33.600 SAY "Output:" ;
FONT "MS Sans Serif", 8 ;
STYLE "BT"
@ 2.846,4.800 SAY "Print:" ;
FONT "MS Sans Serif", 8 ;
STYLE "BT"
@ 4.692,7.200 GET m.p_recs ;
PICTURE &quot;@*RVN \<Current Record;\<All Records&quot; ;
SIZE 1.308,18.500,0.308 ;
DEFAULT 1 ;
FONT &quot;MS Sans Serif&quot;, 8 ;
STYLE &quot;BT&quot;
@ 4.692,36.000 GET m.p_output ;
PICTURE &quot;@*RVN \<Printer;Pre\<view&quot; ;
SIZE 1.308,12.000,0.308 ;
DEFAULT 1 ;
FONT &quot;MS Sans Serif&quot;, 8 ;
STYLE &quot;BT&quot;
@ 10.154,16.600 GET m.prnt_btn ;
PICTURE &quot;@*HT P\<rint;Ca\<ncel&quot; ;
SIZE 1.769,8.667,0.667 ;
DEFAULT 1 ;
FONT &quot;MS Sans Serif&quot;, 8 ;
STYLE &quot;B&quot;
ACTIVATE WINDOW _qjn12zbvh
READ CYCLE MODAL
RELEASE WINDOW _qjn12zbvh
RETURN

Any help in how to change these two procedures would be greatly appreciated.

Don
 
1. In all the places where FRX is present, replace it with &quot;LBX&quot; in the above routines.
2. Suitably name them differently, so that the outines dont clash with print routines.
3. CREATE a label format using LABEL DESIGNER..
CREATE LABEL myAlias and save it just like report.
You must be ok with these, and I hope this helps you.
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top