Groups > dBase > dBase reports > Re: SetParams Filter And BeforeGetValue




SetParams Filter And BeforeGetValue

SetParams Filter And BeforeGetValue
Thu, 13 Mar 2008 09:05:00 -050
Greetings,

I need to query a database for VALUE >= 45

The table field.name "VALUE" is a character field.

I have a datamodule with the field.name "VALUE" filled using
BeforeGetValue as follows:

   FUNCTION VAL_BEFOREGETVALUE

   RETURN (iif( empty( this.value ), ( val( this.parent["cost"].value
) * 1.15 ) , this.value ))

The preview.wfm SetParams has the following code:

    dSet = this.form.hsrptdatamodule1.cl1.rowset
    cVal = aParams[ "VAL" ]
    if not empty( cVal )
        dSet.filter := [VALUE >= ']+ val( cVal ) +[']

When the report renders, there is no data.

Does this mean that the field.name "VALUE" has no data in it
when the SetParams renders the report?

How do I get the report to render with the BeforGetValue data in it
so the SetParams reads it?

Ed


Post Reply
Re: SetParams Filter And BeforeGetValue
Thu, 13 Mar 2008 21:39:13 +010
Maybe your problem is caused by the fact that "VALUE" is a reserved
word.
Try enclosing the field name in colons:

dSet.filter := [:VALUE: >= ']+ val( cVal ) +[']

Roland


Edward Racht wrote
> Greetings,
>
> I need to query a database for VALUE >= 45
>
> The table field.name "VALUE" is a character field.
>
> I have a datamodule with the field.name "VALUE" filled using 
> BeforeGetValue as follows:
>
>   FUNCTION VAL_BEFOREGETVALUE
>
>   RETURN (iif( empty( this.value ), ( val(
this.parent["cost"].value ) * 
> 1.15 ) , this.value ))
>
> The preview.wfm SetParams has the following code:
>
>    dSet = this.form.hsrptdatamodule1.cl1.rowset
>    cVal = aParams[ "VAL" ]
>    if not empty( cVal )
>        dSet.filter := [VALUE >= ']+ val( cVal ) +[']
>
> When the report renders, there is no data.
>
> Does this mean that the field.name "VALUE" has no data in it
> when the SetParams renders the report?
Post Reply
Re: SetParams Filter And BeforeGetValue
Fri, 14 Mar 2008 03:36:04 -050
Roland,

I did as you recommended.  There is no change to the rendering of the report.

I placed hand entered data in the table field.name "VALUE" and the
SetParams worked.

When there is no data hand entered in the table field.name "VALUE" the
SetParams returns a blank form.

Ed



Roland Wingerter Wrote:

> Maybe your problem is caused by the fact that "VALUE" is a
reserved word.
> Try enclosing the field name in colons:
> 
> dSet.filter := [:VALUE: >= ']+ val( cVal ) +[']
> 
> Roland
> 
> 
> Edward Racht wrote
> > Greetings,
> >
> > I need to query a database for VALUE >= 45
> >
> > The table field.name "VALUE" is a character field.
> >
> > I have a datamodule with the field.name "VALUE" filled using

> > BeforeGetValue as follows:
> >
> >   FUNCTION VAL_BEFOREGETVALUE
> >
> >   RETURN (iif( empty( this.value ), ( val(
this.parent["cost"].value ) * 
> > 1.15 ) , this.value ))
> >
> > The preview.wfm SetParams has the following code:
> >
> >    dSet = this.form.hsrptdatamodule1.cl1.rowset
> >    cVal = aParams[ "VAL" ]
> >    if not empty( cVal )
> >        dSet.filter := [VALUE >= ']+ val( cVal ) +[']
> >
> > When the report renders, there is no data.
> >
> > Does this mean that the field.name "VALUE" has no data in
it
> > when the SetParams renders the report?
> 
Post Reply
Re: SetParams Filter And BeforeGetValue
Fri, 14 Mar 2008 10:59:26 +010
Edward Racht wrote
>
> I did as you recommended.  There is no change to the rendering of the 
> report.
>
> I placed hand entered data in the table field.name "VALUE" and
the 
> SetParams worked.
>
> When there is no data hand entered in the table field.name
"VALUE" the 
> SetParams returns a blank form.
-------
Maybe it is not possible to filter on a calculated field? You could use a 
WHERE clause in your SQL statement.

Roland 
Post Reply
about | contact