In the generated reports I cannot go to a new line. I can add only 4 fields side by side but I want to add them in a new line.
If you are just printing to your printer (LPT1) as a device, after entering the code to switch devices from the screen to the printer just reference what line number you want to print on. Here's some code from an old program I used to print the page header, and subsequent headers as needed.
Early in your code:
SET CONSOLE OFF && so your output doesn't echo to the screen while printing.
SET PRINTER ON
SET PRINTER TO LPT1
Then call the Prt_Header()
function to print the first page header. You must keep up with the line numbers as you print your detail records, and when you get to the bottom of the page use the EJECT
command to kick out that page and send another call to Prt_Header()
.
****************************
STATIC FUNCTION Prt_Header()
****************************
nPage += 1
@ 1, 4 SAY DATE()
@ 1, 55 SAY "MyCompany INTERNATIONAL, INC."
@ 1,121 SAY "Page " + STR( nPage, 4, 0)
@ 2, 51 SAY "MY Report Name"
@ 3, 4 SAY "Pay Group: " + cPayGroup
@ 3, 58 SAY "For Period: " + cPeriodMon + "/" + cPeriodYr
@ 4, 4 SAY cLines
@ 5, 4 SAY "EXECUTIVE " + "(" + cParTitle + "): " + cName
@ 5, 70 SAY "Member #:" + cDist
@ 5,100 SAY "Sponsored: " + STR( nNoSponsored, 5, 0 )
@ 6, 21 SAY cAddress
@ 6,100 SAY "Qualified: " + STR( nQualified, 5, 0 )
if .not. empty( cAddress2 )
@ 7, 21 SAY cAddress2
nLine_no := 8
else
nLine_no := 7
endif
@ nLine_no, 21 SAY TRIM(cCity) + ", "+ cState + " " + cZip + " " + =
cFullName
nLine_no += 2
@ nLine_no, 4 SAY "LN LEVEL I. D. NAME"
@ nLine_no, 70 SAY "SALES BONUS PCT"
@ nLine_no, 93 SAY "PHONE LAST ORDER STATUS"
@ nLine_no + 1, 4 SAY cLines
nLine_no += 2
nItem := 0
RETURN NIL
* EOP: Prt_Header()
But, if you're using a report generator this is not what you're looking for.