Posted 1 February 2021, 7:09 am ESTHi all,
TLDR: I need to add an unknown number of rows (like a table) to a report but the Y-axis alignment of them is thrown off when a row grows from wrapped text.
I have a problem I have tried approaching several different ways with little success. I need to add rows to a report (essentially like rows of a table) based on the number of entries in my model, however, if any of the text boxes have text that wraps, it causes all sorts of problems with future rows being added in the right spot.
To track the Y location for the next row I have used a variable that adds the height of the previous row every time a row is added to itself and adds the next row at that location, which works unless the row resizes from text wrapping.
I tried to do it by creating a sub report for each row and adding those to the main report, which works for a little while but if enough rows are added a large gap of whitespace appears between random lines with no noticeable consistency from report to report, despite the fact that the variable tracking the Y location of the next row doesn't show any unusual increases in debug.
I also tried adding the text boxes and whatnot for each row within the report generation without the use of a sub report but in this situation, the increased height is not registered so the next row starts where it would if the previous row had not grown, causing the wrapped text to overlap.
I have seem mention of the timing and execution of the Format event and BeforePrint event potentially affecting this, but have not been able to utilize those in any way to solve this.
Any help would be greatly appreciated!