Module OrdersCR.rv

     1Use Crystal\CheckForCrystal.dg
     2Use dfrptvw.pkg
     3Use DataDict.pkg
     4Use dfRadio.pkg
     5Use Windows.pkg
     6Use cCrystal.pkg
     7Use ORDERHEA.DD
     8
     9DEFERRED_VIEW Activate_oOrdersCR FOR ;
    10;
    11Object oOrdersCR is a ReportView
    12    Set Label to "Orders"
    13    Set Location to 6 5
    14    Set Size to 78 131
    15    Set piMinSize to 78 131
    16
    17    Object Orderhea_DD is a Orderhea_DataDictionary
    18        Send DefineAllExtendedFields
    19    End_Object    // Orderhea_DD
    20
    21    Set Main_DD to Orderhea_DD
    22    Set Server to Orderhea_DD
    23
    24    Object oDestinationGroup is a RadioGroup
    25        Set Size to 47 120
    26        Set Location to 7 6
    27        Set Label to "Output Destination"
    28        Object oScreenRadio is a Radio
    29            Set Label to "Preview"
    30            Set Size to 10 42
    31            Set Location to 15 18
    32            Set Status_Help to "Preview the report to screen"
    33        End_Object    // oScreenRadio
    34
    35        Object oPrinter is a Radio
    36            Set Label to "Printer"
    37            Set Size to 10 37
    38            Set Location to 30 18
    39            Set Status_Help to "Send the report to the default printer"
    40        End_Object    // oPrinter
    41
    42        Procedure Notify_Select_State Integer iToItem Integer iFromItem
    43            Forward Send Notify_Select_State iToItem iFromItem
    44        
    45            If (iToItem = 0) Begin
    46                Set peOutputDestination of oCrystalOrderRpt1 to PRINT_TO_WINDOW
    47            End
    48            Else Begin
    49                Set peOutputDestination of oCrystalOrderRpt1 to PRINT_TO_PRINTER
    50            End
    51        
    52        End_Procedure // Notify_Select_State
    53
    54    End_Object    // oDestinationGroup
    55
    56    Object oPrintButton is a Button
    57        Set Label to "Print"
    58        Set Location to 60 23
    59        Set Status_Help to "Print the report"
    60        Set Default_State to True
    61
    62        Procedure OnClick
    63            Boolean bCrystalOK
    64        
    65            Get CheckCrystalEnvironment of oCheckForCrystal to bCrystalOK
    66            If (bCrystalOK) Begin
    67               Send RunReport of oCrystalOrderRpt1
    68            End
    69            Else Begin
    70                Send DisplayDialog of oCheckForCrystal
    71            End
    72        
    73        End_Procedure // OnClick
    74
    75    End_Object    // oPrintButton
    76
    77    Object oCancelButton is a Button
    78        Set Label to "Cancel"
    79        Set Location to 60 76
    80        Set Status_Help to "Cancel this Panel"
    81
    82        Procedure OnClick
    83            Send Close_Panel
    84        End_Procedure // OnClick
    85        
    86    End_Object    // oCancelButton
    87
    88    Object oCrystalOrderRpt1 is a cCrystal
    89        Set psReportName to "Orders.rpt"
    90
    91        Procedure OnInitializeReport Handle hoReport
    92            Handle hoTerms hoShipVia
    93            Variant[][2] vTerms
    94            Variant[][2] vShipVia
    95        
    96            Get CreateCDO of hoReport "Terms.ttx" to hoTerms
    97            If (hoTerms) Begin
    98                Get TableData of Terms_table to vTerms
    99                Send AppendCDOData of hoReport hoTerms vTerms
   100            End
   101        
   102            Get CreateCDO of hoReport "ShipVia.ttx" to hoShipVia
   103            If (hoShipVia) Begin
   104                Get TableData of Ship_Table to vShipVia
   105                Send AppendCDOData of hoReport hoShipVia vShipVia
   106            End
   107        End_Procedure // OnInitializeReport
   108        
   109    End_Object    // oCrystalOrderRpt1
   110
   111CD_End_Object    // oOrdersCR
   112