Subject Re: report canrender solution
From Charlie <tm@tc.com>
Date Thu, 06 Dec 2018 16:42:41 -0500
Newsgroups dbase.getting-started

Thanks very much for your suggestions.  I was surprised to find this solution!

As it turns out my code was OK.  What was wrong for some reason if text6 and additamt equaled higher than 999.99, text9 was blank.

I fixed it by putting 99999999.99 in the picture property for text9.  Now it works great!!  

Thanks again, I did learn a lot from the suggestions.

Mervyn Bick Wrote:

> On 2018-12-06 6:53 AM, Ken Mayer wrote:
> > On 12/5/2018 7:53 PM, charlie wrote:
> >> Hi... I am having trouble with this:
> >>
> >> function TEXT9_canRender()
> >>          this.text =
> >> this.parent.text6.text()+this.parent.textadditamt1.text()
> >>        return true
> >
> > Well, text is ... text, right? So what are you getting? Have you tried
> > using val() around these?
>
> Well, sort of. :-)
>
> Here we're talking of a property which can actually hold numeric values.
> The property is named 'text' but it could just as easily have been named
> 'value'.
>
> The naming of the textadditamt1 object is typical of where a field has
> been placed on the report from the Field Palette.  The contents of the
> text property will be a codeblock and evaluating the codeblock by using
> the () call operator is almost certain to return a numeric value if the
> name is anything to go by.
>
> The fact that Charlie is using the () call operator in conjunction with
> the text property of text6 implies that this text property also contains
> a codeblock.  If it's not a codeblock I would expect an "Expression
> expected" error.
>
>
> >   this.text = val(this.parent.text6.text()) +
> > val(this.parent.textadditamt1.text())
>
> If either text6.text() or textadditamt1.text() returned characters then
> Charlie's code would concatenate the two values and not leave a blank.
> My money's on a null lurking somewhere.
>
> Mervyn.
>
>