O$: assign $top to a report text object

Bastiaan Olij bastiaan at basenlily.me
Thu Jul 24 19:39:19 EDT 2014


Jim,

Rudolfs email is on the money if you want to control things from the
$print method which is very powerful. However for simple positioning of
fields before you start printing it is important to know that reports do
not fit the mould.

This is because the foundations of the printing engine goes back to the
days of matrix printers and the sorts where you print by line. You can
really get your reports to screw up if you handle this wrongly.

Every object on a report has a property called $lineno which specifies
the line on the report the field is placed (i have no idea why its not
in the property manager, it exists, trust me.
Within a line the $top controls fine tuning of where the line is placed
(and would be ignored on old printers that do not support this).

When you assign a $top that places the field one line (or more) lower
then its $lineno Omnis automatically starts adjusting things, it can
even accidentally end up in another section. I think this may in part be
why the property manager doesn't show the $lineno as it shows the $top
relative to the top of the section. I have a feeling there is some
behind the scenes magic going on here. I've had it fail on me several
times where I'm repositioning fields on my report and when I close and
reopen the report all of a sudden the field is somewhere completely
different (though admittedly, the last time this happened to me I was
still using Studio 4 so it may be fixed).

Note that when you resize sections all the fields below have their
$lineno adjust so hardcoding them is dangerous. I usually have a hidden
field on my report who's $lineno I grasp before adding/moving fields
around as part of customizing a report instance.

Cheers,

Bas

On 24/07/14 11:26 PM, Jim Pistrang wrote:
> Hi all,
>
> I am working with a TEXT object in the header section of a report.  I am able to $assign the $left property of the object in the $construct of the report.  However, when I try to assign the $top property the object disappears.  Am I doing something wrong?  Is this a bug?  A feature?
>
> My code:
>
> this works:  Do $cinst.$objs.1013.$left.$assign(1)
>
> this does not work:  Do $cinst.$objs.1013.$top.$assign(1)
>
> Thanks,
>
> Jim
>


-- 
Kindest Regards,

Bastiaan Olij
e-mail: bastiaan at basenlily.me
web: http://www.basenlily.me
Skype: Mux213
http://www.linkedin.com/in/bastiaanolij




More information about the omnisdev-en mailing list