compile function REACTOR_LOG_RPT2() begin condition pre: post: end condition declare function getprinterlist, getprofilestring, writeprofilestring, extdevicemode declare function msg, set_property, send_event, dialog_box, utility, get_property declare function set_printer, Printer_Select declare subroutine rlist, or_view, activate_save_select, yield declare subroutine reactor_log_rpt2_prn $insert rlist_equates $insert msg_equates Params = dialog_box( 'REACTOR_LOG_RPT2', @window, '*CENTER' ) if Params = 'CANCEL' or Params = '' then return 0 end open 'SYSLISTS' to SysListsTable else MsgInfo = '' MsgInfo = -2 MsgInfo = -2 MsgInfo = 'Unable to open SYSLISTS...' Void = msg( '', MsgInfo) return 0 end ListsId = 'REACTOR_LOG_RPT2*':@station write '' on SysListsTable, ListsId else MsgInfo = '' MsgInfo = -2 MsgInfo = -2 MsgInfo = 'Unable to clear SYSLISTS ':ListsId:'...' Void = msg( '', MsgInfo ) return 0 end convert '*' to @fm in Params StartDateFrom = Params<1> StartDateThru = Params<2> Reactors = Params<3> DirToPrinter = Params<4> Stat = utility( 'CURSOR', 'H' ) Stmt = 'SELECT REACTOR_LOG BY REACTOR BY START_DATE WITH CATEGORY = "A"' * CATEGORY = "A" is to force it to only select pass down entries, since * this is a pass down report if StartDateFrom and StartDateThru then Stmt := " AND WITH START_DATE FROM ":QUOTE(StartDateFrom):' TO ':QUOTE(StartDateThru) end else if StartDateFrom then Stmt := " AND WITH START_DATE GE ":QUOTE(StartDateFrom) end if StartDateThru then Stmt := " AND WITH START_DATE LE ":QUOTE(StartDateThru) end end if Reactors then swap @vm with "' '" in Reactors Reactors = "'":Reactors:"'" Stmt := ' AND WITH REACTOR = ':Reactors end *IF @USER4 = 'BRYCE_M' THEN *DEBUG *END rlist( Stmt, target_savelist$, ListsId, '', '' ) activate_save_select( ListsId ) if @reccount then Cmd = "LIST REACTOR_LOG ID-SUPP REACTOR JUSTLEN 5" Cmd:= " START_DATE JUSTLEN 10 START_TIME JUSTLEN 10 NOTES JUSTLEN 40 ENTRY_ID_NAME JUSTLEN 20" Cmd:= " HEADING ":'"':" Run Date: 'TS39'Page 'P''LS22'Pass Down Report " Cmd:= StartDateFrom:' To ':StartDateThru:'"' if DirToPrinter = 'Yes' then *rlist( Cmd, 0, '', '', '' ) PrintPath = Printer_Select('',1) ;* Get Default Printer Void = set_printer( 'INIT', '', '', '':@fm:1.25, 1, '', PrintPath ) reactor_log_rpt2_prn( iconv( StartDateFrom, 'D' ), iconv( StartDateThru, 'D' ) ) Void = set_printer( 'TERM' ) Void = set_printer( 'INIT', '', '', '', 0, '' ) Void = set_printer( 'TERM' ) end else or_view( '', Cmd ) Void = set_property( 'ORPRV.PRINT', 'ENABLED', 0 ) *Void = set_property( 'ORPRV', 'VISIBLE', 3 ) WinId = 'ORPRV' loop while get_property( WinId, 'HANDLE' ) yield() repeat ToPrint = '' MsgInfo = '' MsgInfo = 'Do you want to print this report?' MsgInfo = '?' MsgInfo = -2 MsgInfo = -2 MsgInfo = 'BNY' MsgInfo = 2 ;* default to no ToPrint = msg( @window, MsgInfo ) if ToPrint then activate_save_select( ListsId ) *rlist( Cmd, 0, '', '', '' ) Void = set_printer( 'INIT', '', '', '':@fm:1.25, 1, '' ) reactor_log_rpt2_prn( iconv( StartDateFrom, 'D' ), iconv( StartDateThru, 'D' ) ) Void = set_printer( 'TERM' ) Void = set_printer( 'INIT', '', '', '', 0, '' ) Void = set_printer( 'TERM' ) end end end else MsgInfo = '' MsgInfo = -2 MsgInfo = -2 MsgInfo = 'NO Records meeting your date criteria!!' MsgInfo = '!' Void = MSG( '', MsgInfo ) end write '' on SysListsTable, ListsId else MsgInfo = '' MsgInfo = -2 MsgInfo = -2 MsgInfo = 'Unable to clear SYSLISTS ':ListsId:'...' Void = msg( '', MsgInfo ) return 0 end return 0