B4J Question jPOI - Setting margins??

Robert Valentino

Well-Known Member
Licensed User
Longtime User
According to web searches the POI supports setting margins on the sheet level

But I am unable to find any routines to do this.

Has anyone been able to set margins?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
'Margin: 0 = Left, 1 = Right, 2 = Top, 3 = Bottom, 4 = Header, 5 = Footer
Sub GetMargin(Sheet As PoiSheet, Margin As Short) As Double
   Dim jo As JavaObject = Sheet
   Return jo.RunMethod("getMargin", Array(Margin))
End Sub

Sub SetMargin(Sheet As PoiSheet, Margin As Short, Size As Double)
   Dim jo As JavaObject = Sheet
   jo.RunMethod("setMargin", Array(Margin, Size))
End Sub
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Thanks so much.

Where would I find information on these fields (or rather what other fields are available - like setting Header / Footer fields
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Trying to setCenter which is part of the interface HeaderFooter Interface but get "setCenter" not found.

How do I point or direction this command to the right interface?
 
Upvote 0
Top