Focal Point
[CLOSED] Compound Rpt : Issue while adding constant value to position of components.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1397012396

April 24, 2020, 11:48 AM
srajeevan
[CLOSED] Compound Rpt : Issue while adding constant value to position of components.
Hi,

I have a compound report where i need to display the content for different page size.
So i have an amper variable for page size and use that variable to check for different page size.
The issue i am facing is for somme page size,say A4 , i have to apply a top margin and left margin for the compound report.So i have to add the same top and left margin to the position of different components in my compound report to get an uniform look.

When i do that as shown below,

  
-DEFAULTH &RIGHTMARGIN = 0.345
-DEFAULTH &TOPMARGIN = 0.485

--------------
-------------

OBJECT=STRING, NAME='txt1', TEXT='<font face="ITALIC" color="#ffffff" size=22>Welcome</font>', POSITION=((&RIGHTMARGIN+0.500) (&TOPMARGIN+1.875)), MARKUP=ON, WRAP=ON, DIMENSION=(7.000 0.930),  METADATA='left: 0.500in; top: 1.875in; width: 7.000in; height: 0.930in; font-family: ITALIC; font-size: 22pt; position: absolute; z-index: 2;', $



This wont' work as i get bad style sheet error on POSITION because of the addition operation.
I don't want to hardcore by adding the values as i have reports with 100's of lines.
Is there any way i can make the addition work for the POSITION or any other way.?

This message has been edited. Last edited by: FP Mod Chuck,


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
April 24, 2020, 01:00 PM
FP Mod Chuck
srajeevan

I think you need some dialog manager logic to do the math on the &RIGHTMARGIN and &TOPMARGIN before you reference it in the stylesheet with a -SET based on the page size you want.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
April 24, 2020, 02:50 PM
srajeevan
Okay.
 
-SET &RIGHTMARGIN = 0.345;
-SET &TOPMARGIN = 0.485;


Right now i am passing the value as it is for A4 size.Even with that i the position won't do the addition operation i think.The value is being passed.Here is the error message that i get.

(FOC3202) BAD VALUE IN STYLESHEET FILE AT LINE 37: POSITION=((0.345 + 0.500) (0.485 + 1.875))



WF8206,Windows 7,8,10
HTM,PDF,EXCEL
April 24, 2020, 03:51 PM
FP Mod Chuck
Srajeevan

Do the math in the -SET to a different variable


-SET &RM = &RIGHTMARGIN + 0.500;
-SET TM = *TOPMARGIN + 1.875;


OBJECT=STRING, NAME='txt1', TEXT='Welcome', POSITION=((&RM) (&TM)), MARKUP=ON, WRAP=ON, DIMENSION=(7.000 0.930), METADATA='left: 0.500in; top: 1.875in; width: 7.000in; height: 0.930in; font-family: ITALIC; font-size: 22pt; position: absolute; z-index: 2;', $



Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
April 24, 2020, 04:22 PM
srajeevan
Hi Chuck,
Thanks for the suggestion.
I could do like that if i have only one or few components.But i have like 50+ components in a fex and the position values changes for each components.So having such -SET statements for each component is a not a possible solution for me.


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
April 24, 2020, 04:56 PM
FP Mod Chuck
Srajeevan

Putting math in the stylesheet will not work so all I was trying to do was give you another way to accomplish setting the position value. Hopefully someone else will have an answer that is acceptable for you.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
April 27, 2020, 09:22 AM
srajeevan
I agree with you.
I was looking for any other possible solution if there is.

Thanks


WF8206,Windows 7,8,10
HTM,PDF,EXCEL