Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing using generic / text only printer
Message
De
12/03/2009 16:46:26
 
 
À
12/03/2009 12:45:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01387345
Message ID:
01387520
Vues:
49
>>Hi All:
>>
>>I'm still working on my Clipper to VFP conversion.
>>
>>Problem:
>>
>>I'm printing a text file by appending it into a cursor. I then print the a report from the cursor to the Generic / Text only printer. The font I'm using is HVTerminal, which is a font that prints those funny characters as lines, which I want.
>>
>>BUT, the report looks totally different on my client's machine, even though I have the same Generic / Text Only printer installed on both machines.
>>
>>I'm saving the printer environment in the report.
>>
>>Thanks,
>>
>>Yossi
>
>One option is to send the characters to the printer, via code. My download #9991 assists you with this task - but be warned that you can't use the existing (FRX) reports, you have to program from scratch.

Hilmar:

I have since solved the above problem, but I still have a problem, as I'll now describe:

The Clipper program which I'm working with, which was designed for DOS, prints to the DOS printer thus:
set device to printer
@ 0,1 say ' '
llFirstTime = .t.
use SomeTable
Do while !eof()
  If llFirstTime
    Do PrintHeader  
    llFirstTime = .f.
  endif
  If prow() > 55
    do Printerfooter  && which at the end issues an EJECT command
  @ prow() + 1 say Field1 + ' ' + field2
  skip
enddo

set device to screen

return

proc printheader

@ 0,1 say wierd characters that resolve to nice lines in the DOS world

return
To get around the wierd characters, I bought HVTerminal fonts from a company in Australia, created an FRX file that has one field in it with the HVTerminal font, and changed the above program to SET DEVICE to file joe.txt.

I then execute the following code:
SET DEVICE TO SCREEN

CREATE CURSOR joeCursor  ;
	(cDetail c(250))

APPEND FROM joe.txt TYPE SDF 

IF RECCOUNT() > 0
	REPORT FORM joetest NOCONSOLE PREVIEW 
ENDIF
The problem that I still have:

1. In order to make the page eject, I need a routine to print a bunch of blank lines until the page ejects, since printing EJECT to the file doesn't accomplish this, but this seems to be PRINTER SPECIFIC. How do I get around this? This needs to work with multiple printers.

2. If I don't save the printer environment, how would that help? How would the report work with all printers?

I hope I explained myself properly.

Thanks,

Yossi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform