Use Crystal\CheckForCrystal.dg Use dfrptvw.pkg Use DataDict.pkg Use dfRadio.pkg Use Windows.pkg Use cCrystal.pkg Use ORDERHEA.DD DEFERRED_VIEW Activate_oOrdersCR FOR ; ; Object oOrdersCR is a ReportView Set Label to "Orders" Set Location to 6 5 Set Size to 100 158 Set piMinSize to 105 219 Object Orderhea_DD is a Orderhea_DataDictionary Send DefineAllExtendedFields End_Object // Orderhea_DD Set Main_DD to Orderhea_DD Set Server to Orderhea_DD Object oDestinationGroup is a RadioGroup Set Size to 47 120 Set Location to 7 18 Set Label to "Output Destination" Object oScreenRadio is a Radio Set Label to "Preview" Set Size to 10 42 Set Location to 15 18 Set Status_Help to "Preview the report to screen" End_Object // oScreenRadio Object oPrinter is a Radio Set Label to "Printer" Set Size to 10 37 Set Location to 30 18 Set Status_Help to "Send the report to the default printer" End_Object // oPrinter Procedure Notify_Select_State Integer iToItem Integer iFromItem Forward Send Notify_Select_State iToItem iFromItem If (iToItem = 0) Begin Set peOutputDestination of oCrystalOrderRpt1 to PRINT_TO_WINDOW End Else Begin Set peOutputDestination of oCrystalOrderRpt1 to PRINT_TO_PRINTER End End_Procedure // Notify_Select_State End_Object // oDestinationGroup Object oPrintButton is a Button Set Label to "Print" Set Location to 60 32 Set Status_Help to "Print the report" Set Default_State to True Procedure OnClick Boolean bCrystalOK Get CheckCrystalEnvironment of oCheckForCrystal to bCrystalOK If (bCrystalOK) Begin Send RunReport of oCrystalOrderRpt1 End Else Begin Send DisplayDialog of oCheckForCrystal End End_Procedure // OnClick End_Object // oPrintButton Object oCancelButton is a Button Set Label to "Cancel" Set Location to 60 88 Set Status_Help to "Cancel this Panel" Procedure OnClick Send Close_Panel End_Procedure // OnClick End_Object // oCancelButton Object oCrystalOrderRpt1 is a cCrystal Set psReportName to "Orders.rpt" Procedure OnInitializeReport Handle hoReport Handle hoTerms hoShipVia Variant[][2] vTerms Variant[][2] vShipVia Get CreateCDO of hoReport "Terms.ttx" to hoTerms If (hoTerms) Begin Get TableData of Terms_table to vTerms Send AppendCDOData of hoReport hoTerms vTerms End Get CreateCDO of hoReport "ShipVia.ttx" to hoShipVia If (hoShipVia) Begin Get TableData of Ship_Table to vShipVia Send AppendCDOData of hoReport hoShipVia vShipVia End End_Procedure // OnInitializeReport End_Object // oCrystalOrderRpt1 CD_End_Object // oOrdersCR