Use DFAllRpt.pkg Use Basic\CustBasicRptImages.inc // contains the images for the report Open Customer Use dfrptvw.pkg Use dfRadio.pkg Use Windows.pkg DEFERRED_VIEW Activate_oCustomerListBR FOR ; ; Object oCustomerListBR is a ReportView Property Integer piSortIndex Public 1 Set Label to "Customer List" Set Location to 6 6 Set Size to 80 180 Object oDestination is a RadioGroup Set Size to 50 80 Set Location to 5 5 Set Label to "Output Device:" Object oScreen is a Radio Set Label to "Screen" Set Size to 10 39 Set Location to 15 10 Set Status_Help to "Preview the report to screen" End_Object // oScreen Object oPrinter is a Radio Set Label to "Printer" Set Size to 10 37 Set Location to 30 10 Set Status_Help to "Send the report to the default printer" End_Object // oPrinter // set the Output_Device_Mode each time the radio button changes Procedure Notify_Select_State Integer iNewItem Integer iOldItem Forward Send Notify_Select_State iNewItem iOldItem If (iNewItem=0) Set Output_Device_Mode To PRINT_TO_WINDOW Else Set Output_Device_Mode To PRINT_TO_PRINTER End_Procedure End_Object // oDestination Object oOrderRadio is a RadioGroup Set Size to 50 80 Set Location to 5 95 Set Label to "Report Order:" Object oNumber is a Radio Set Label to "Number" Set Size to 10 41 Set Location to 15 10 Set Status_Help to "Sort by customer number" End_Object // oNumber Object oName is a Radio Set Label to "Name" Set Size to 10 35 Set Location to 30 10 Set Status_Help to "Sort by customer name" End_Object // oName // set the piSortIndex each time the radio button changes Procedure Notify_Select_State Integer iNewItem Integer iOldItem Forward Send Notify_Select_State iNewItem iOldItem Set piSortIndex To (iNewItem + 1) End_Procedure End_Object // oOrderRadio Object oOkButton is a Button Set Label to "OK" Set Size to 14 51 Set Location to 62 71 Set Default_State to True Procedure OnClick Send StartReport End_Procedure End_Object // oOkButton Object oCancelButton is a Button Set Label to "Cancel" Set Location to 62 125 Procedure OnClick Send Request_Cancel End_Procedure End_Object // oCancelButton Procedure StartReport Integer iOutputDevice Handle hoThisWorkspace String sCurDir sDataPath String sFileName Get Output_Device_Mode to iOutputDevice If (iOutputDevice=PRINT_TO_WINDOW) Begin // save current location Get_Current_Directory to sCurDir // get workspace data path (all users must have r/w rights to it) to output the temp file there Get phoWorkspace of ghoApplication to hoThisWorkspace Get psDataPath of hoThisWorkspace to sDataPath Get PathAtIndex of hoThisWorkspace sDataPath 1 to sDataPath // set current directory to DataPath Set_Directory sDataPath Make_Temp_File "TXT" sFileName Move (".\" - sFileName) to sFileName Set Output_Device_Name to sFileName End Else Begin Set Output_Device_Name to "WinLST:" End Send Run_Report If (iOutputDevice=PRINT_TO_WINDOW) Begin Runprogram background "NotePad" sFileName EraseFile sFileName End // restore previous location Set_Directory sCurDir End_Procedure // StartReport Object oCustomer_BasicReport is a BasicReport Report_Main_File Customer Set Report_Title to "Printing Customer Names" Function Starting_Main_Report Returns Integer Integer iRetVal Integer iIndex Forward Get Starting_Main_Report to iRetVal Get piSortIndex To iIndex Report_Index BY iIndex // set the sort order Sysdate Footer.1 // set date for report Function_Return iRetVal End_Function Procedure_Section Page_Top as CustHdr Integer iPage Get Page_Count To iPage Print iPage OutPut_PageCheck End_Procedure Procedure_Section Body as CustBody Send Update_Status (String(Customer.Customer_Number)- ":" * Customer.Name ) Print Customer.Customer_number Print Customer.Name OutPut_PageCheck End_Procedure Procedure_Section Page_Bottom as Footer OutPut_PageCheck End_Procedure End_Object // Customer_BasicReport CD_End_Object // oCustomerListBR