Use Crystal\CheckForCrystal.dg Use dfrptvw.pkg Use dfRadio.pkg Use Windows.pkg Use cCrystal.pkg DEFERRED_VIEW Activate_oOrdersByCustomerCR FOR ; ; Object oOrdersByCustomerCR is a ReportView Set Label to "Orders by Customer" Set Location to 2 23 Set Size to 92 191 Set piMinSize to 92 258 Object oDetailRadioGroup is a RadioGroup Set Size to 40 100 Set Location to 15 11 Set Label to "Order Detail" Object oRadio1 is a Radio Set Label to "Show Order Detail" Set Size to 10 74 Set Location to 12 10 End_Object // oRadio1 Object oRadio2 is a Radio Set Label to "Show Summary" Set Size to 10 65 Set Location to 25 10 End_Object // oRadio2 Set Current_Radio to 0 Function IsDetail Returns Integer Function_Return (Current_Radio(self)=0) End_Function End_Object // oDetailRadioGroup Object oRunButton is a Button Set Label to "Run Report" Set Size to 14 53 Set Location to 20 122 Set Default_State to True Procedure OnClick Boolean bCrystalOK Get CheckCrystalEnvironment of oCheckForCrystal to bCrystalOK If (bCrystalOK) Begin Send RunReport of oCrystalReport1 End Else Begin Send DisplayDialog of oCheckForCrystal End End_Procedure End_Object // oRunButton Object oCancelButton is a Button Set Label to "Cancel" Set Size to 14 53 Set Location to 42 122 Procedure OnClick Send Close_Panel End_Procedure End_Object // oCancelButton Object oCrystalReport1 is a cCrystal // Mark an entire report section of {type} as suppressed // Available Options are: // crReportHeader // crPageHeader // crGroupHeader // crDetail // crGroupFooter // crPageFooter // crReportFooter Procedure MakeSectionsInvisible integer eSectionType Integer iGroup Handle hoReport Handle hoAreas hoArea Variant vAreas vArea Integer iAreas iArea iKind Get ReportObject to hoReport Get Create of hoReport U_cCrystalAreas to hoAreas // areas collection Get Create of hoReport U_cCrystalArea to hoArea // area object Get ComAreas of hoReport to vAreas // areas dispatch Set pvComObject Of hoAreas To vAreas // attach dispatch to object Get ComCount Of hoAreas To iAreas For iArea from 1 to iAreas Get ComItem of hoAreas iArea to vArea Set pvComObject Of hoArea To vArea // attach area dispatch to object Get ComKind of hoArea to iKind // is it the right kind, if so, suppress If (iKind=eSectionType) Begin If (iGroup) Begin If (ComGroupNumber(hoArea)=iGroup) Begin Set ComSuppress of hoArea to True End End Else Set ComSuppress of hoArea to True End Loop Send Destroy of hoArea //destroy objects used Send Destroy of hoAreas End_Procedure // MakeSectionsInvisible Set psReportName to "OrdersByCustomer.rpt" // This is a hook message sent by the OpenReport procedure. You may use this // procedure to set selection values, print options, etc. This procedure is // intended for augmentation; it has no action by default. Procedure OnInitializeReport handle hoReport Boolean bDetail // Set the details section to visible/invisible. Get IsDetail of oDetailRadioGroup To bDetail If (bDetail) Begin Set ComReportTitle of hoReport to "List all Orders for Customers" End Else Begin Set ComReportTitle of hoReport to "List Order summary information for Customers" Send AssignFormula of hoReport "DetailType" '"Show Summary Information"' Send MakeSectionsInvisible crDetail 0 Send MakeSectionsInvisible crGroupHeader 2 // Group2 Send MakeSectionsInvisible crGroupFooter 2 // Group2 End End_Procedure // OnInitializeReport // This event is called when a report is being printed to screen. Procedure OnDisplayReport Handle hoReport Handle hoViewer Forward Send OnDisplayReport hoReport Get ActiveXReportViewerObject of hoReport to hoViewer Set ComDisplayTabs of hoViewer To True Set ComDisplayGroupTree of hoViewer To True Set ComEnableGroupTree of hoViewer To True Set ComEnableStopButton of hoViewer To True Set ComEnableCloseButton of hoViewer To True Set ComEnableDrillDown of hoViewer To True End_Procedure // DisplayReport End_Object // oCrystalReport1 CD_End_Object // oOrdersByCustomerCR