Nebula Research and Development

Print Wizard Demo 1

 
Print Wizard
Demo 2
 
Make your voice heard in the Nebula Forum.

This PDF was generated by Print Wizard, with Fax flag turned off.

FAX shown here as images for your convenience.

   

This is the code that generated that fax:

*
* Demo 1 for Print Wizard
*
* Nebula Research and Development
* http://Nebula-RnD.com
* v1.0 2008-dec-01
*
* Code is verbose for readability and lines are
* short to allow pasting without wrapping. To
* facilitate copy/paste into ED/AE, etc, all empty
* lines are comments.
*
* This program is artificially long due to the comments
* and code structuring. The original version, less
* readable but exact same functionality, has 65 lines.
*
* If you'd like assistance writing reports that make
* use of Print Wizard, contact us: Sales@Nebula-RnD.com
*
*
TIMESHEET.OVERLAY = "C:\WinTemp\PrintWizard\form1.tif"
* Set the orientation
ORIENT = "PORTRAIT"
GOSUB SET.MARGINS
NOW = OCONV(DATE() , 'D2/') : " " : OCONV(TIME(), 'MTS')
FAXING = 1; * Set to zero to print instead of faxing
PRINTER ON
*
IF FAXING THEN
FAX.COVER = "C:\WinTemp\PrintWizard\faxcover1.tif"
FAX.TO.NUMBER = "19991112222"
FAX.TO.NAME = "Yura Recipient"
FAX.SUBJECT = "Testing PrintWizard"
FAX.NOTE = "Note for cover page - not used here"
FAX.FROM.NAME = "Ima Sender"
GOSUB DEFINE.FAX.COMMAND
PRINT FAX.CMD
END
*
PRINT "<PWML>"
*
IF FAXING THEN GOSUB OUTPUT.COVER.PAGE
GOSUB OUTPUT.MAIN.REPORT
*
PRINTER CLOSE
*
STOP
*
DEFINE.FAX.COMMAND: *
*
FAX.CMD = "!FAX32"
FAX.CMD := " /X" : FAX.TO.NUMBER
FAX.CMD := " /T" : FAX.TO.NAME
FAX.CMD := " /J" : FAX.SUBJECT
FAX.CMD := " /N" : FAX.NOTE
*
RETURN
*
SET.MARGINS: *
* Calculate margins based on orientation
*
IF ORIENT = "LANDSCAPE" THEN
PWIDTH = 11
PHEIGHT = 8
END ELSE
PWIDTH = 8
PHEIGHT = 11
END
RMARGIN = PWIDTH-.5
BMARGIN = PHEIGHT-.5
*
RETURN
*
* Start off the document with HTML or PWML so parsing
* will occur
*
OUTPUT.COVER.PAGE: *
*
PRINT "<pagesize orientation=": ORIENT:
PRINT " overlay=" : FAX.COVER :
PRINT ">"
PRINT
PRINT "<body topmargin=.5in leftmargin=.5in":
PRINT " rightmargin=" : RMARGIN : "in":
PRINT " bottommargin=" : BMARGIN : "in>"
* Required PRE tag
PRINT "<pre>"
*
* Set cursor positions for fields on page
X = "1.7"; * X is the column, Y is the row
TO.XY = "<goto x=" : X : "in y=3.9in>"
DATE.XY = "<goto x=" : X : "in y=4.5in>"
FROM.XY = "<goto x=" : X : "in y=4.8in>"
SUBJECT.XY = "<goto x=" : X : "in y=5.13in>"
MESSAGE.XY = "<goto x=1.2in y=6in>"
*
PRINT TO.XY : FAX.TO.NAME
PRINT DATE.XY : NOW
PRINT FROM.XY : FAX.FROM.NAME
PRINT SUBJECT.XY : FAX.SUBJECT
*
SYMBOL = "&#X263C;"
PRINT "<p>" : MESSAGE.XY : SYMBOL :
PRINT "This is some ":
PRINT "<font pointsize=14>important</font> info ":
PRINT "for <u>you</u></p>"
PRINT "<formfeed>":
*
RETURN
*
OUTPUT.MAIN.REPORT: *
*
PRINT "<pagesize orientation=": ORIENT:
PRINT " overlay=" : TIMESHEET.OVERLAY :
PRINT " duplex=left" :
PRINT ">"

PRINT "<body topmargin=.5in leftmargin=.5in":
PRINT " rightmargin=" : RMARGIN : "in":
PRINT " bottommargin=" : BMARGIN : "in>"
* Required PRE tag
PRINT "<pre>"
*
* Define locations for header data
*
NAME.XY = "<goto x=1.6in y=1.2in>"
EMPID.XY = "<goto x=6in y=1.2in>"
EMAIL.XY = "<goto x=1.6in y=1.46in>"
DEPT.XY = "<goto x=6in y=1.46in>"
PURPOSE.XY = "<goto x=1.6in y=1.7in>"
APPROVED.XY = "<goto X=6in y=1.7in>"
TRIP.XY = "<goto x=1.2in y=2.2in>"
DATE.XY = "<goto x=2.2in y=2.2in>"
*
* Artificial data, would normally be taken from
* data files
*
HDR = ""
INFO = "A. Jones,12345,aj@corp.com,"
INFO := "Sales,Meet with client,Margie Boss"
HDR<-1> = INFO
INFO = "B. Smith,45678,bs@corp.com,"
INFO := "Marketing,Payoff vendor,I. Shmooz"
HDR<-1> = INFO
CONVERT "," TO @VM IN HDR
TRIPS = ""
TRIPS = "3.0~3/MAR-6/MAR,2.5~10/MAR"
TRIPS<-1> = TRIPS
TRIPS<-1> = TRIPS
CONVERT "," TO @VM IN TRIPS
CONVERT "~" TO @SVM IN TRIPS
*
* Loop on data, create a new page with each header
*
PAGES = DCOUNT(HDR,@AM)
FOR P = 1 TO PAGES
*
* Assemble a variable that is one print line here,
* though the output appears on many output lines
LINE = NAME.XY : HDR<P,1>
LINE := EMPID.XY : HDR<P,2>
LINE := EMAIL.XY : HDR<P,3>
LINE := DEPT.XY : HDR<P,4>
LINE := PURPOSE.XY : HDR<P,5>
LINE := APPROVED.XY : HDR<P,6>
*
* Output the entire header block
PRINT LINE
*
EVENTS = DCOUNT(TRIPS<P>,@VM)
FOR E = 1 TO EVENTS
DOWN = 80*E
LINE = TRIP.XY
* Shift down to next line
IF E > 1 THEN LINE := "<goto y=+" : DOWN : ">"
LINE := TRIPS<P,E,1>
LINE := DATE.XY
IF E > 1 THEN LINE := "<goto y=+" : DOWN : ">"
LINE := TRIPS<P,E,2>
PRINT LINE
NEXT E
*
PRINT "<formfeed>"; * same as CHAR(12)
*
NEXT P
*
RETURN
*
END

This is the PrintWizard Markup Language created by the code:

<PWML>
<pagesize orientation=PORTRAIT overlay=C:\WinTemp\PrintWizard\faxcover1.tif>

<body topmargin=.5in leftmargin=.5in rightmargin=7.5in bottommargin=10.5in>
<pre>
<goto x=1.7in y=3.9in>Yura Recipient
<goto x=1.7in y=4.5in>12/01/08 23:46:42
<goto x=1.7in y=4.8in>Ima Sender
<goto x=1.7in y=5.13in>Testing PrintWizard
<p><goto x=1.2in y=6in>&#X263C;This is some <font pointsize=14>important</font> info for <u>you</u></p>
<formfeed><pagesize orientation=PORTRAIT overlay=C:\WinTemp\PrintWizard\form1.tif duplex=left>
<body topmargin=.5in leftmargin=.5in rightmargin=7.5in bottommargin=10.5in>
<pre>
<goto x=1.6in y=1.2in>A. Jones<goto x=6in y=1.2in>12345<goto x=1.6in y=1.46in>aj@corp.com<goto x=6in y=1.46in>Sales<goto x=1.6in y=1.7in>Meet with client<goto X=6in y=1.7in>Margie Boss
<goto x=1.2in y=2.2in>3.0<goto x=2.2in y=2.2in>3/MAR-6/MAR
<goto x=1.2in y=2.2in><goto y=+160>2.5<goto x=2.2in y=2.2in><goto y=+160>10/MAR
<formfeed>
<goto x=1.6in y=1.2in>B. Smith<goto x=6in y=1.2in>45678<goto x=1.6in y=1.46in>bs@corp.com<goto x=6in y=1.46in>Marketing<goto x=1.6in y=1.7in>Payoff vendor<goto X=6in y=1.7in>I. Shmooz
<goto x=1.2in y=2.2in>3.0<goto x=2.2in y=2.2in>3/MAR-6/MAR
<goto x=1.2in y=2.2in><goto y=+160>2.5<goto x=2.2in y=2.2in><goto y=+160>10/MAR
<formfeed>

 
 

© 2009 Nebula Research and Development

Home | About Us | News | FAQ | Products
Services | Articles | Contact Us | Search Site

E-mail for Product and Service inquiries.
Please report site issues to . Thank you!