LPARA ; ReportDbfName, ; ScaleFactor LOCAL ; OldSelect, ; BandBarHight * *** read notes at the end OldSelect = SELECT() BandBarHight = 2083.333 *BandBarHight = 2030.500 IF ScaleFactor > 1 * *** convert 25% to .25 ScaleFactor = ScaleFactor/100 ENDIF SELE 0 USE (ReportDbfName) ALIAS _Report AGAIN * *** count how many 'bands' we have. that includes header, detail, etc. * *** get a new cursor with only the bands * *** and sort the bands so we can calculate a placement SELE q_a.* ; FROM ; _Report q_a ; WHERE ; UPPER(q_a.Platform) = "WINDOWS" .AND. ; q_a.ObjType = 9 ; ORDER BY ; q_a.ObjType, q_a.ObjCode ; INTO CURSOR cur_TempReport * *** now create a list with all the bands and placements BandCount = 0 CurrentVPosition = 0 DIME a_Bands(1, 2) SELE cur_TempReport SCAN * *** ok we have a band IF TYPE("a_Bands(alen(a_Bands, 1), 1)") = "N" DIME a_Bands(ALEN(a_Bands, 1)+1, 2) ENDIF a_Bands(ALEN(a_Bands, 1), 2) = _Report.HEIGHT BandCount = ALEN(a_Bands, 1) IF BandCount = 1 CurrentVPosition = 0 ELSE CurrentVPosition = CurrentVPosition + a_Bands(BandCount-1, 2) + BandBarHight ENDIF a_Bands(ALEN(a_Bands, 1), 1) = CurrentVPosition ENDSCAN USE IN cur_TempReport * *** SELE _Report SCAN * *** adjust font size IF _Report.FONTSIZE > 0 REPL ; _Report.FONTSIZE WITH _Report.FONTSIZE - (_Report.FONTSIZE * ScaleFactor) ENDIF * *** adjust top position 'VPos' IF _Report.VPos <> 0 .AND. _Report.ObjType <> 9 * *** find the placement in which band we are BandMultiplier = 0 FOR i=1 TO BandCount IF BETWEEN(_Report.VPos, a_Bands(i, 1), a_Bands(i, 1)+a_Bands(i, 2)) * *** ok, we have found the band this object is positioned in BandMultiplier = i-1 EXIT ENDIF ENDFOR * *** take the original VPos NewVPos = _Report.VPos * *** substract the 'band-height' NewVPos = NewVPos - (BandBarHight * BandMultiplier) * *** now substract the scaling percentage NewVPos = NewVPos - (NewVPos * ScaleFactor) * *** now add the band height again NewVPos = NewVPos + (BandBarHight * BandMultiplier) REPL ; _Report.VPos WITH NewVPos ENDIF * *** adjust height (this is also the line width on horizontal lines) IF _Report.HEIGHT > 0 .AND. _Report.ObjType <> 9 REPL ; _Report.HEIGHT WITH _Report.HEIGHT - (_Report.HEIGHT * ScaleFactor) ENDIF * *** adjust left position 'HPos' IF _Report.HPos <> 0 REPL ; _Report.HPos WITH _Report.HPos - (_Report.HPos * ScaleFactor) ENDIF * *** adjust width (this is also the line width on vertical lines) IF _Report.WIDTH > 0 REPL ; _Report.WIDTH WITH _Report.WIDTH - (_Report.WIDTH * ScaleFactor) ENDIF ENDSCAN * *** resize the bands only SCAN IF _Report.ObjType = 9 * *** we don't need to calculate the vpos * *** because on bands this is always 0 * *** take the original height NewHeight = _Report.HEIGHT * *** now substract the scaling percentage NewHeight = NewHeight - (NewHeight * ScaleFactor) REPL ; _Report.HEIGHT WITH NewHeight ENDIF ENDSCAN USE IN _Report SELECT(OldSelect)