(form "20195" (size 60 21)

    (help "The BLOCK MODEL REPORT function can generate a report of one or "
        "more block model attributes grouped by attribute values or by "
        "dimensions (Y,X, or Z).  A report may be generated for all blocks, "
        "or for blocks contained within a constraint.  Volumes will be "
        "automatically reported.  Mass values (such as tonnes) may be "
        "obtained by multiplying the volume by a constant or by an "
        "attribute.  Each attribute may be reported as a mass or volume "
        "weighted average or aggregate."
    )

    (heading "Block model report"
    )

    (label (position 5 2) 
        (text "Report Description"
        )
    )
    (field "rpt_desc_1" (position 5 3) (display_length 50) (input allowed)
    (max_length unlimited) (null allowed)
    (help "The two lines of text entered for REPORT DESCRIPTION will be "
          "included in the header of the output *.NOT report file."))

  (scroll_block "report attributes" (position 5 7) (size 35 2)
     (extra 0 2)
     (scroll_size 200 2)
     (repeat interactive (grow 0 1) (instances 1 (min 1) (max 200)))
    (top
      (label 
        (position 1 0) (text "Enter names of attributes to report"))
        (label
            (position 1 1)
            (text "Attribute")
        )
        (label
            (position 15 1)
            (text "Weight by")
        )
        (label
            (position 24 1)
            (text "Report")
        )
    )
        
    (main
      (field "rpt_attribute" (position 1 0) (display_length 12) (input allowed)
        (max_length "BM_MAX_ATT_NAME_LEN") (auto_next off) (null allowed)
        (help "You may include any numeric attributes in the report. "
              "There is no limit on the number of attributes you may "
              "report."))

        (field "rpt_display"
            (position 15 0)
            (display_length 4)
            (input allowed)
            (value_in "Yes" "No")
            (default "Yes")
        )
        (field "low_cut"
            (position 30 0)
            (display_length 8)
            (max_length 256)
            (input allowed)
            (null disallowed)
        )
        (field "upper_cut"
            (position 30 0)
            (display_length 8)
            (max_length 256)
            (input allowed)
            (null disallowed)
        )
        (field "rpt_attribute_wt"
            (position 15 0)
            (display_length 4)
            (null disallowed)
            (input allowed)
            (value_in "Mass" "Volume" "None")
            (default "Mass")
            (help   "The attribute may be weighted by mass or by volume.  "
                    "If Mass weighting is selected then a specific gravity "
                    "must be supplied for the Multiplication factor for "
                    "Volume else volume weighting will be done."
            )
        )
        (field "rpt_attribute_avg"
            (position 24 0)
            (display_length 8)
            (input allowed)
            (null disallowed)
            (auto_next off)
            (value_in "Average" "Aggregate")
            (default "Average")
            (help   "The weighted average or aggregate of the attribute "
                    "may be reported."
            )
        )
        (field "rpt_expression"
            (position 30 0)
            (display_length 8)
            (max_length 256)
            (input allowed)
            (auto_next off)
        )
    )
  )

    (label 
        (position 5 9) 
        (text "Use Volume Adjustment?")
    )
    (field "use_vol"
        (position 30 9)
        (display_length 2)
        (max_length 4)
        (input allowed)
        (null disallowed)
        (value_in "Yes" "No")
        (default "No")
        (help   "The physical volume of a block may be different to that "
                "implied by the blocks' dimensions in the model and so a "
                "volume adjustment should be made.  Examples of this may "
                "be an expansion factor for excavated material, or "
                "if differential dilution and reduction has been applied. "
                "Select Yes if you wish to use pre-determined volume "
                "adjustments for blocks."
        )
    )

    (field "vol_att_label" 
        (position 37 9)
        (display_length 15)
        (foreground (user_option "form_foreground"))
        (background (user_option "form_background"))
        (input disallowed)
        (value_in "Attribute")
        (default "Attribute")
        (dependency (value "use_vol") == "Yes")
    )
    (field "vol_att"
        (position 45 9)
        (display_length 12)
        (max_length "BM_MAX_ATT_NAME_LEN")
        (input allowed)
        (null disallowed)
        (auto_next off)
        (dependency (value "use_vol") == "Yes")
        (help   "Select the attribute which contains the volume adjustment "
                "factor.  This factor must be expressed as a ratio."
        )
    )

    (label 
        (position 60 9) 
        (text "Format Headers?")
    )
    (field "Format_head"
        (position 80 9)
        (display_length 2)
        (max_length 4)
        (input allowed)
        (null disallowed)
        (value_in "Yes" "No")
        (default "Yes")
    )
    (field "fillAllCells"
        (position 80 9)
        (display_length 2)
        (max_length 4)
        (input allowed)
        (null disallowed)
        (value_in "Yes" "No")
        (default "No")
    )
    (field "pivotCompatible"
        (position 80 9)
        (display_length 2)
        (max_length 4)
        (input allowed)
        (null disallowed)
        (value_in "Yes" "No")
        (default "No")
    )
    (field "cullEmpty" (position 80 9) (display_length 2) (max_length 4)
        (input allowed) (null allowed) )
    (field "volDecimals" (position 80 9) (display_length 2) (max_length 40)
        (input allowed) (null allowed) )
    (field "geometryType" (position 80 9) (display_length 2) (max_length 20)
        (input allowed) (null allowed) )
    (field "DTMFile" (position 80 9) (display_length 5) (max_length 250)
        (input allowed) (null disallowed) 
		(dependency (value "geometryType") == "Solids")
	)
    (field "StringFile" (position 80 9) (display_length 5) (max_length 250)
        (input allowed) (null disallowed) 
		(dependency (value "geometryType") == "Strings")
	)
    (field "extension" (position 80 9) (display_length 2) (max_length 4)
        (input allowed) (null allowed) )
    (field "stringMin" (position 80 9) (display_length 2) (max_length 20)
        (input allowed) (null allowed) )
    (field "stringMax" (position 80 9) (display_length 2) (max_length 20)
        (input allowed) (null allowed) )
    (field "StringRange" (position 80 9) (display_length 2) (max_length 128)
        (input allowed) (null allowed) )
    (field "DTMRange" (position 80 9) (display_length 2) (max_length 128)
        (input allowed) (null allowed) )
    (field "use_partial" (position 80 9) (display_length 2) (max_length 4)
        (input allowed) (null allowed) )
    (field "precision" (position 80 9) (display_length 2) (max_length 4)
        (input allowed) (null allowed) )
    (field "partialPercentAttr" (position 80 9) (display_length 2) (max_length "BM_MAX_ATT_NAME_LEN")
        (input allowed) (null allowed) )
    (field "topDtmFile" (position 80 9) (display_length 5) (max_length 250)
        (input allowed) (null disallowed) 
		(dependency (value "geometryType") == "Between DTMS")
    )
    (field "top_object_id" (position 80 9) (display_length 5) (max_length 250)
        (input allowed) (null disallowed)
    (dependency (value "geometryType") == "Between DTMS") )
    (field "top_trisolation_id" (position 80 9) (display_length 5) (max_length 250) 
        (input allowed) (null disallowed)
    (dependency (value "geometryType") == "Between DTMS") )
    (field "bottomDtmFile" (position 80 9) (display_length 5) (max_length 250)
        (input allowed) (null disallowed) 
		(dependency (value "geometryType") == "Between DTMS")
	)
    (field "bot_object_id" (position 80 9) (display_length 5) (max_length 250)
        (input allowed) (null disallowed)
    (dependency (value "geometryType") == "Between DTMS") )
    (field "bot_trisolation_id" (position 80 9) (display_length 5) (max_length 250) 
        (input allowed) (null disallowed)
    (dependency (value "geometryType") == "Between DTMS") )
    (field "boundaryStringFile" (position 80 9) (display_length 5) (max_length 250)
        (input allowed) (null disallowed) 
		(dependency (value "geometryType") == "Between DTMS")
	)
    (field "boundaryStringRange" (position 80 9) (display_length 2) (max_length 128)
        (input allowed) (null allowed) )

  (label (position 5 10) (text "Multiplication factor for Volume"))
  (field "vol_mult_factor" (position 30 10) (display_length 9) (input allowed)
    (value_in "None" "Attribute" "Value") (auto_next off)
    (null disallowed) (max_length 9)
    (help "The volume of each block reported may be multiplied by a value, "
          "or by an attribute to obtain a mass value in the report.\n"
          "NONE: Volume only will be included in the report.\n"
          "VALUE:  The volume and mass will be reported.  The volume of "
          "all blocks will be multiplied by the value entered at the "
          "Value: prompt to determine the mass.\n"
          "ATTRIBUTE: The volume and mass will be reported.  The volume of "
          "each block will be multiplied by the value contained within the "
          "attribute nominated to determine the mass.\n"
          "Example:  If you have an attribute called SG that contains the "
          "specific gravity of the material, select ATTRIBUTE here, and "
          "enter SG at the Attribute Name prompt."))

    (field "att_name_label" 
        (position 5 11)
        (display_length 14)
        (foreground (user_option "form_foreground"))
        (background (user_option "form_background"))
        (input disallowed)
        (value_in "Attribute Name")
        (default "Attribute")
        (dependency (value "vol_mult_factor") == "Attribute")
    )

  (field "mult_factor_att_name" (position 30 11) (display_length 20) 
    (input allowed) (max_length "BM_MAX_ATT_NAME_LEN")
    (dependency (value "vol_mult_factor") == "Attribute")
    (null allowed)
    (help "Enter the name of the attribute which is to be multiplied by "
          "the volume of each block to obtain the mass.\n" 
          "Example:  If you are using the metric system and "
          "have an attribute call SG that contains the "
          "specific gravity of the material, enter SG.\n"
          "Example:  If you are using the imperial system and "
          "have an attribute call TCF that contains the "
          "tons per cubic foot of the material, enter TCF.\n"))

    (field "value_label" 
        (position 5 11)
        (display_length 14)
        (foreground (user_option "form_foreground"))
        (background (user_option "form_background"))
        (input disallowed)
        (value_in "Value")
        (default "Value")
        (dependency (value "vol_mult_factor") == "Value")
    )

  (field "mult_factor_value" (position 30 11) (display_length 8) 
    (input allowed) (max_length 16) (decimals 8)
    (dependency (value "vol_mult_factor") == "Value")
    (format real_8) (null disallowed)
    (help "The value entered here will be multiplied by the volume of each "
          "block to determine the mass.\n" 
          "Example:  If you are using the metric system, enter "
          "specific gravity.\n"
          "Example:  If you are using the imperial system, enter "
          "tons per cubic foot..\n"))

  (scroll_block "group attributes" (position 5 16) (size 50  2)
     (extra 0 2)
     (scroll_size 50 2)
     (repeat interactive (grow 0 1) (instances 1 (min 1) (max 10)))
    (top
      (label (position  1 0) (text "Attributes or dimensions to GROUP"))
      (label (position  1 1) (text "by specified in correct ORDER"))
      (label (position 35 0) (text "Numeric"))
      (label (position 35 1) (text "Range")))
    (main
      (field "group_field" (position 1 0) (display_length 25) (input allowed)
        (max_length "BM_MAX_ATT_NAME_LEN") (auto_next off) (null allowed)
        (help "Attributes may be reported grouped by attribute values or by "
              "dimension.  The grouping Attribute may be either numeric "
              "or character. If grouping by a numeric "
              "attribute then use a range to define the groups. If grouping "
              "by a character attribute a secondary form will be displayed to "
              "obtain the different character values for grouping. If the "
              "data is to be grouped by more "
              "than one attribute or dimension, the order in which they are "
              "specified will have a major influence on the format of the "
              "report.\n"
              "Example:  If the attribute GOLD is to be reported based on "
              "the cutoff values of 1,1.5,2,2.5 and 4, and these cutoffs "
              "are to be reported on each 6m elevation range between 240 "
              "and 282, you would enter the Z values first, and the GOLD "
              "values second:\n"
              "Z                240,282,6\n"
              "GOLD       1,2.5,0.5;4;999\n"))
      (field "numeric_range" (position 30 0) (display_length 18) (input allowed)
        (max_length "MAX_RNG_LENGTH") (format range) (null allowed)
        (help (field "group_field")))))

  (default_buttons)
)
