Use DFAllRpt Use VWinRpt // For conversion to VPE Open Customer Open OrderHea Activate_View Activate_Winreport_Rec for WinReport_Rec Object WinReport_Rec is a ReportView Set Label to "WinPrint (WinReport) Demo of Print Order Rpt3" Set Size to 108 209 Object OutputRadio is a RadioGroup Set Label to "Output Order" Set Size to 57 121 Set Location to 10 8 Set Status_Help to "Choose order to print report" Object R1 is a Radio Set Label to "Order Number" Set Location to 10 10 End_Object // R1 Object R2 is a Radio Set Label to "Customer ID Order" Set Location to 25 10 End_Object // R2 Object R3 is a Radio Set Label to "Customer Name Order" Set Location to 40 10 End_Object // R3 End_Object // OutputRadio Object PrintTo is a CheckBox Set Label to "Print to Screen" Set Location to 75 18 Set Checked_State to TRUE Set Status_Help to "Determine if Report is Printed to Printer or Window" End_Object // PrintTo Object PrintSetUp is a Button Set Label to "Printer Setup" Set Location to 15 137 Set Status_Help to "Select and set up Printer and Paper" Procedure OnClick Send SetupReport End_Procedure End_Object // PrintSetUp Object ReportBn is a Button Set Label to "Report" Set Location to 32 137 Set Status_Help to "Print the Selected report" Procedure OnClick Send StartReport End_Procedure End_Object // ReportBn Object CancelBn is a Button Set Label to "Cancel" Set Location to 49 137 Set Status_Help to "Close this Panel" Procedure OnClick Send Request_Cancel End_Procedure End_Object // Cancelbn Function OutputOrder returns Integer // 0 - order id, 1 - cust id, 2 - cust name Function_Return (Current_Radio(OutputRadio(Current_Object))) End_Function Function Print_to_Screen_State Returns Integer Function_Return ( Checked_State(PrintTo(Current_Object))) End_Function // ID_Order #INCLUDE VRpt_Rec.rpt // Adds oRpt_W3a - Send Run_Report // oRpt_W3b - Send Run_Report // Set CustId_State to T|F Procedure SetupReport send DFPrintSetup to (Report_Object_Id(Current_Object)) End_Procedure Procedure StartReport Local Integer ToScreen IdxId Get Print_to_Screen_State to ToScreen If ToScreen ; Set OutPut_Device_Mode to PRINT_TO_WINDOW Else ; Set OutPut_Device_Mode to PRINT_TO_PRINTER Get OutputOrder To IdxId // 0-order id, 1-cust id, 2-cust name If IdxId eq 0 ; send run_report to (oRpt_W3a(current_object)) else Begin Set CustId_State of (oRpt_W3b(Current_Object)) to (IdxId=1) send run_report to (oRpt_W3b(current_object)) End End_Procedure End_Object // WinReport3