frames and output files

whwar9739

Member
Hey gang,

I am trying to use a frame to format output to a file.
The issue I am having is that it only displays the last record of the table rather than each record.

Example:
Code:
DEFINE STREAM slo-stream.
OUTPUT STREAM slo-stream TO out-file.

DEFINE FRAME f-frame
   tt-table.field
   tt-table.field2
   tt-table.field3.....

FOR EACH tt-table NO-LOCK
   WITH FRAME f-frame:

   DISPLAY STREAM slo-stream
      tt-table.field
      tt-table.field2
      tt-table.field3.....
END. /* FOR EACH tt-table */

Any help would be appreciated.
Thanks,
 

nate100

Member
I tried the following and it works for me:

{mfdeclre.i}

def var i as int.
def var out-file as char.
DEFINE FRAME f-frame
so_mstr.so_nbr.

DEFINE STREAM slo-stream.

OUTPUT STREAM slo-stream TO test.txt.

FOR EACH so_mstr no-lock
where so_domain = global_domain
i = 1 to 10 WITH FRAME f-frame:
DISPLAY STREAM slo-stream so_mstr.so_nbr.
END. /* FOR EACH tt-table */

output stream slo-stream close.
 

whwar9739

Member
What is in the mfdeclre.i file?
Is there something in there that is allowing this to work?
Also I would like to be able to define the frame so I can control the output through it. Such as headers and column labels.
 

nate100

Member
I tried the following and it works for me:

{mfdeclre.i}

def var i as int.
def var out-file as char.
DEFINE FRAME f-frame
so_mstr.so_nbr.

DEFINE STREAM slo-stream.

OUTPUT STREAM slo-stream TO test.txt.

FOR EACH so_mstr no-lock
where so_domain = global_domain
i = 1 to 10 WITH FRAME f-frame:
DISPLAY STREAM slo-stream so_mstr.so_nbr.
END. /* FOR EACH tt-table */

output stream slo-stream close.
 

mrobles

Member
HI Whwar
I test your code and it works ok and displays each record of a table.
Try using a down statment after the display.
Use a counter to display and verify if it reads all the records.
If your problem continuous, please write all the code.
 

lord_icon

Member
Greetings,

I am sorry, I don`t get what you are trying to do or why.
You are wanting to output data to a file. Yet you are concered with the display and formating?? The output is NOT displayed by Progress / OE, you are passing it onto the OS by outputing to a file.
You are half way there already, using a stream.
DEFINE the stream and OUTPUT THROUGH the STREAM TO wherever appropriate.

DEFINE STREAM s1.
OUTPUT STREAM s1 TO C:\um\bob.txt.
FOR EACH customer:
PUT STREAM s1 name "/".
END.
OUTPUT STREAM s1 CLOSE.

Then play around with formating to get the data displayed how you would like.
 

lord_icon

Member
mfdeclre.i file?

Greetings,

The mfdeclre.i file? is simply an include file to include MFG/PRO system variables. It just allows the external procedure to be compatible with, and able to attach as an external program to MFG/PRO - You do not need to worry about it.
 

whwar9739

Member
Found out the issue was the old code was broken and was displaying too many entries when the new code was only displaying the one.
 
Top