Display text file contents in PAGE

nacho

New Member
Hi to you all,
I need to know if there's a way of displaying the contents of a flat file (in this case, a .prn previously created by an mfg option) in the screen, in PAGE or PRINTER. I've try with streams and displaying a character variable with the text, but neither of this had worked.
Thanks,
 
Hola Nacho

Prueba esto:

CURRENT-WINDOW:WIDTH = 200.
DEF VAR EDITOR-1 AS CHAR VIEW-AS EDITOR SIZE-CHAR 150 BY 40 LARGE.
DEF BUTTON BOT.
DEF FRAME X
EDITOR-1
BOT
WITH WIDTH 200.
editor-1:READ-FILE(SEARCH('DESP_TXT.W')).
ENABLE ALL WITH FRAME X.
WAIT-FOR CHOOSE OF BOT

Esto presenta un archivo de texto. No un archivo que haya sido asociado a una impresora.
This show a text file, not a file associated with a printer.
 
Hola Nacho

Prueba esto:

CURRENT-WINDOW:WIDTH = 200.
DEF VAR EDITOR-1 AS CHAR VIEW-AS EDITOR SIZE-CHAR 150 BY 40 LARGE.
DEF BUTTON BOT.
DEF FRAME X
EDITOR-1
BOT
WITH WIDTH 200.
editor-1:READ-FILE(SEARCH('DESP_TXT.W')).
ENABLE ALL WITH FRAME X.
WAIT-FOR CHOOSE OF BOT

Esto presenta un archivo de texto. No un archivo que haya sido asociado a una impresora.
This show a text file, not a file associated with a printer.

Gracias mrobles, voy a agregarlo a mi código y te cuento.
¿A qué te refieres con un archivo "asociado a una impresora"?. Hasta donde yo sé, el .prn es un archivo plano, más algunos caracteres de control, como ^L...

Thanks mrobles, i'm going to put that on my code and let you know then.
What do you mean when you talk about a "printer associated file"?. As far as I know, the .prn file is a flat file, plus some control characters like ^L...
 
Hi Nacho / Hola Ignacio

Si al imprimir, seleccionas una impresora e indicas imprimir en un archivo, se genera un archivo para impresión en esa impresora específica. Ese archivo no se podrá ver como reporte con este código.

When you print and you select a printer indicating print to a file, then you obtain a file to be printed in that especfic printer. That file can not be seen with this code.

Estos programas te pueden ayudar.
El .W recibe
1.-El nombre de un archivo a desplegar. Cuidado por que al salir lo borra.
2.- 3 parámetros mas (si usas el _osprint.p para enviar a imprimir) para indicar desde que página
imprimes, el font a usar al imprimir, la forma de llamar al _osprint y el tamaño de página)
El .p lo envpia a word.
Solo cambiale los botones

This programs can help you.
The .W recives
1.- The name of the file to be displayed. Teke care due al the end it is erased.
2.- 3 parameters more (if you use the _osprint.p program to print the file) to indicate the start page
the font to use, the way to to call the _osprint and how and the page size).
The .p sends the file to word.
Only change the buttons



Congratulations for your new president.

Mario Robles
 

Attachments

Probé el código, y funciona, pero sólo en la versión terminal (CHUI). En la versión Desktop me muestra la pantalla vacía. ¿Hay que escribir algo adicional?
Estoy usando QAD 2009 (v 2.8.1.487)
Gracias!

I've tried the code, and it works fine in CHUI, but it's not working in Desktop. There is something else you have to write?
I'm using QAD 2009 (v 2.8.1.487)
Thanks!
 
Don't know anything about QAD versions and the Progress/OpenEdge versions it relates.

Are you running on OpenEdge 10.0A+ or on some Progress Version 9?


Regards, RealHeavyDude.
 
Back
Top