Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 3.0 REPORT TO FILE ASCII
Message
From
26/03/1998 11:01:42
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/03/1998 07:17:16
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00087239
Message ID:
00087307
Views:
40
>I'm using Roman 10cpi font for my report. On printing the data to the printer the report prints out fine, however on reporting to file it is observed that some the lines overlap. I'm not being able to figure thsi out and any suggestions would be helpfull.
>
>Thanks
>
>Sonali
If you mean some extra CR you may try following code (It's an old code for FP 2x and might need revision).
function rep2file
parameters orgfile
moldsel=alias()
create cursor tempcurs (fle m(10))
insert into tempcurs values (" ")
append memo fle from (ORGFILE)
replace fle with ;
	STRTRAN(CHRTRAN(STRTRAN(strtran(;
		fle,chr(12),"%%");
		,CHR(13)+CHR(10),"%%");
		,CHR(13),"þ");
		,"%%",CHR(13)+CHR(10))

mtempfile="F"+substr(sys(3),2)+".txt"
copy memo fle to (mtempfile)
use
select (moldsel)
handle=fopen(mtempfile)
ifp_size=fseek(handle,0,2)
=fseek(handle,0,0)
HANDLE1=FCREATE(orgfile)
DO WHILE !FEOF(HANDLE)
	=FPUTS(HANDLE1,SMOOTH(FGETS(HANDLE,ifp_size)),ifp_size)
ENDDO
=fclose(handle)	
=fclose(handle1)	
erase (mtempfile)
WAIT CLEAR

FUNCTION SMOOTH
PARAMETERS LINE
IF OCCURS("þ",LINE)=0
	RETURN LINE
ENDIF
DIMENSION LINES[OCCURS("þ",LINE)+1]
MXLEN=0
FOR OCCHAR=1 TO OCCURS("þ",LINE)
	LINES[OCCHAR]=SUBSTR(LINE,1,AT("þ",LINE)-1)
	LINE=SUBSTR(LINE,AT("þ",LINE)+1)
	MXLEN=MAX(MXLEN,LEN(LINES[OCCHAR]))
ENDFOR	
LINES[ALEN(LINES,1)]=LINE
MXLEN=MAX(MXLEN,LEN(LINE))
if mxlen=0
	return ""
endif	
for maxline=1 to ALEN(LINES,1)
	lines[maxline]=padr(lines[maxline],mxlen+1," ")
endfor	
for linenum=1 to ALEN(LINES,1)-1
	for chrpos=1 to len(lines[ALEN(LINES,1)-linenum+1])
		if substr(lines[ALEN(LINES,1)-linenum+1],chrpos)=" "
			loop
		endif
		lines[ALEN(LINES,1)-linenum]=;
			stuff(lines[ALEN(LINES,1)-linenum],chrpos,1,;
				substr(lines[ALEN(LINES,1)-linenum+1],chrpos,1))
	endfor
endfor
return lines[1]
cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform