Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Zooming/Scaling
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00933455
Message ID:
00933702
Views:
21
>>i don't know what the messurent is in the table. i am using the value directly in the table.
>
>When you are in the Report Designer, look at the rule and see if it is in inches or centimeters.
>
>> you were talking about 'FRU'. what is a FRU?
>
>This is "FoxPro Reporting Units". Basically, if you are running in inches, it is 1/10,000 of an inch. This is the UOM used in all the VPOS, HPOS, HEIGHT, and WIDTH fields in the report's FRX.
>
>
>Cathy


ok i work with inches. i guess it doesn't realy matter since i work with the value in the table which is FRU (thanks for the education). here is what i have so far, but it's still not working. any ideas?
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)
Previous
Reply
Map
View

Click here to load this message in the networking platform