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_oOrdersCRLoop for ; ; Object oOrdersCRLoop is a ReportView Set Label to "Orders" Set Location to 6 5 Set Size to 107 131 Set piMinSize to 78 131 Object Orderhea_DD is a Orderhea_DataDictionary End_Object // Orderhea_DD Set Main_DD to Orderhea_DD Set Server to Orderhea_DD Object oDestinationGroup is a RadioGroup Set Size to 60 120 Set Location to 7 6 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 If (iToItem = 1) Begin Set peOutputDestination of oCrystalOrderRpt1 to PRINT_TO_PRINTER End If (iToItem = 2) Begin Set peOutputDestination of oCrystalOrderRpt1 to PRINT_TO_FILE End End_Procedure // Notify_Select_State Object oFile is a Radio Set Label to "File" Set Size to 10 37 Set Location to 46 18 Set Status_Help to "Send the report to pdf" End_Object End_Object // oDestinationGroup Object oPrintButton is a Button Set Label to "Print" Set Location to 90 23 Set Status_Help to "Print the report" Set Default_State to True Procedure OnClick Boolean bCrystalOK Integer iLoop i Get Value of oFormLoop to iLoop Get CheckCrystalEnvironment of oCheckForCrystal to bCrystalOK If (bCrystalOK) Begin If (iLoop<=1) Begin Send RunReport of oCrystalOrderRpt1 End Else Begin For i from 1 to iLoop Send RunReport of oCrystalOrderRpt1 Loop End 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 90 76 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 Procedure OnExportReport Handle hoReport Handle hoExport Set pbExportPrompt of hoReport to False Forward Send OnExportReport hoReport Get ExportObject of hoReport to hoExport If (hoExport) Begin Set ComDiskFileName of hoExport to "E:\Report.rtf" Set ComFormatType of hoExport to crEFTExactRichText // Rich Text Set ComDestinationType of hoExport to crEDTDiskFile End End_Procedure // OnExportReport End_Object // oCrystalOrderRpt1 Object oFormLoop is a Form Set Size to 13 54 Set Location to 72 68 Set Label to "Loop #" End_Object CD_End_Object // oOrdersCR