Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Faxing multiple reports
Message
From
20/11/2001 17:20:36
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00583891
Message ID:
00584234
Views:
42
As far as I can see, Ed Rauh's solution is of the type 'rawprint'. A series of bytes is rawly sent to the printer (spooler) and control characters should already be in that series of bytes.

My initial 'solution' to my problem was:

- Optionally let the user call sys(1037) to choose another printer and/or change the printer's settings:
	set printer to    && Empties set('print',1) 
	sys(1037)
- Find out what printer is in use:
	if empty( set( 'print', 1 ) )
		lcSelectedPrinter = set( 'print', 3 )
	else
		lcSelectedPrinter = set( 'print', 1 )
	endif
- Send the (let's say 3) reports to files:
	lcPath = addbs( sys( 2023 ) )
	report form x1 to file ( lcPath + 'MRP_1.TMP' )
	...
	report form x2 to file ( lcPath + 'MRP_2.TMP' )
	...
	report form x3 to file ( lcPath + 'MRP_3.TMP' )
- Concatenate the files to a single file:
	lcPath   = addbs( sys( 2023 ) )
	lnFnd    = adir( laTempfile, lcPath + 'MRP_???.TMP' )
	lcC      = ''

	for ln = 1 to lnFnd
		lcFile = laTempfile[ ln, 1 ]
		lcC    = lcC + filetostr( lcPath + lcFile )
	next

	lcFile = 'MRP____.TMP'
	strtofile( lcC, lcPath + lcFile )
- Send that single file raw (!) to the printer
	*	Source: Universal Thread
	*	Parm 2 also occurs in aNetResources( aa,{computername}, 0 ) if it's shared.
	*	Parm2 is a port or UNC.
	*	returns 0 if failed
	DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
	   STRING @SourceFileName, ;
	   STRING @DestFileName, ;
	   INTEGER bFailIfExists

	if copyfile( lcPath + lcFile, lcSelectedPrinter, 0 ) = 0

		messagebox( "Printing to '" + lcSelectedPrinter + "' failed." )
	endif
This is essentially the same as Ed Rauh's class does.. I think.

Note that each file will have printer control codes on board. Those codes are determined by the printer in use at the moment that REPORT FORM is called. The design works perfect as long as one is printing to ..indeed.. a printer.

However, when we direct output to the fax (the option in the Docuprinter's setup, realized through sys(1037) ) then the REPORT FORM x TO FILE generates NO FILE! And as a consequence the concatenation of nothing also generates nothing to fax.

I imagine that Ed's solution will give the same complication.

Further reflections are very welcome!
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform