Page 1 of 1

Velocity reports: How to do Fixed or Absolute positioning?

PostPosted: Tue Oct 12, 2021 5:21 am
by roddy
When using "position: fixed" or "position: absolute" in a template used by Velocity; it throws an exception:
Code: Select all
ERROR com.servoy.j2db.util.Debug - org.xhtmlrenderer.render.AnonymousBlockBox incompatible with org.xhtmlrenderer.newtable.TableCellBox


We need to be able to ensure the positioning of a rendered field; in this case it is to ensure the position of the address for a standard window envelope. The data above this position can be of varying size; how can we fix a position of a field using a Velocity template?

Re: Velocity reports: How to do Fixed or Absolute positionin

PostPosted: Tue Oct 12, 2021 5:37 am
by roddy
If anyone else comes across this; I created the content above in a div that uses a fixed height.

Re: Velocity reports: How to do Fixed or Absolute positionin

PostPosted: Tue Oct 12, 2021 5:47 pm
by ptalbot
Yes setting absolute width/height of divs is the way to go, or using tables with specific row heights and cell widths.
I had a similar issue for a client who needed to print barcodes on sticker paper, they needed to be positioned very precisely.
With a little bit of trial/error, I managed to build a table grid that placed all the barcode as needed.