values inclusion into report (tube length is in feet)

!!RealFMT = object FORMAT()
!!RealFMT.DIMENSION = 'L'
!!RealFMT.UNITS = 'FINCH'
!!RealFMT.FRACTION = TRUE
!!RealFMT.DENOMINATOR = 4
!!RealFMT.ZEROS = FALS
!a = !!collectallfor('pipe','',!!ce)
do !s values !a
!tubis = !!collectallfor('BRAN MEM',|TYPE EQ 'TUBI'|,!s)
!tubelength = 0
do !tubi values !tubis
!tubelength = !tubelength + !tubi.itle
!tubelength1 = !tubelength.value().string(!!RealFMT)
enddo
enddo

above function gives me my tube length from all pipes which is working fine.

if i add this in report the result is as below, it is filling values in all fields like elbow, gask, flan, i need to restrict this to only tube only in my report.

the fill value in the report is the last value of tubelength of a pipe if i run from a zone.

this !tubelength1 values i need to keep into my report.

var !bmem collect all (BRAN MEM) for ce

this is the original collection for my report for other parameters.

below is my subtotal method which is not giving proper results.

var !qty eval ( QUANTITY ) for all from !bmem


-- Get tube quantity
do !i indices !bmem
!ref = !bmem[!i].dbref()
if( !ref.type.eq('TUBI') ) then
!qty[!i] = !ref.itle.value().string('D1')
endif
enddo

required help on this.