From: David on
New to C/AL coding and trying to put some conditional formating in a
reprt. The following code does not work:

IF WOLINE.Price = 0 THEN CurrReport.SHOWOUTPUT :=True
Else
CurrReport.SHOWOUTPUT := False;

Neither does this:

IF WOLINE.Type ='Charge' THEN CurrReport.SHOWOUTPUT :=False;


WOLINE is defined as global variable with a datatype as Record and a
Subtype as the name of the table. The code is in the body section of
the report "On Pre Section"

I would appreciate any help. TIA

David

From: Luc Van Dyck on
"David" wrote:

> New to C/AL coding and trying to put some conditional formating in a
> reprt. The following code does not work:
>
> IF WOLINE.Price = 0 THEN CurrReport.SHOWOUTPUT :=True
> Else
> CurrReport.SHOWOUTPUT := False;
>
> Neither does this:
>
> IF WOLINE.Type ='Charge' THEN CurrReport.SHOWOUTPUT :=False;
>
>
> WOLINE is defined as global variable with a datatype as Record and a
> Subtype as the name of the table. The code is in the body section of
> the report "On Pre Section"

I presume there is somewhere a WOLINE.GET or WOLINE.FIND in your code
somewhere?

Try this:

CurrReport.SHOWOUTPUT(WOLINE.Price = 0);

and this:

CurrReport.SHOWOUTPUT(NOT(WOLINE.Type ='Charge'));

Luc Van Dyck
webmaster http://mibuso.com
From: David on
On Feb 16, 2:24 pm, Luc Van Dyck
<LucVanD...(a)discussions.microsoft.com> wrote:
> "David" wrote:
> > New to C/AL coding and trying to put some conditional formating in a
> > reprt. The following code does not work:
>
> > IF WOLINE.Price = 0 THEN CurrReport.SHOWOUTPUT :=True
> > Else
> > CurrReport.SHOWOUTPUT := False;
>
> > Neither does this:
>
> > IF WOLINE.Type ='Charge' THEN CurrReport.SHOWOUTPUT :=False;
>
> > WOLINE is defined as global variable with a datatype as Record and a
> > Subtype as the name of the table. The code is in the body section of
> > the report "On Pre Section"
>
> I presume there is somewhere a WOLINE.GET or WOLINE.FIND in your code
> somewhere?
>
> Try this:
>
> CurrReport.SHOWOUTPUT(WOLINE.Price = 0);
>
> and this:
>
> CurrReport.SHOWOUTPUT(NOT(WOLINE.Type ='Charge'));
>
> Luc Van Dyck
> webmasterhttp://mibuso.com- Hide quoted text -
>
> - Show quoted text -



Luc -

I have never used WOLINE.GET or WOLINE.FIND . Can you tell me where
they should be used in the context of what I am trying to accomplish?

From: Luc Van Dyck on
"David" wrote:

> I have never used WOLINE.GET or WOLINE.FIND . Can you tell me where
> they should be used in the context of what I am trying to accomplish?

If you define a record-variable WOLINE, you need to retrieve the record
value somewhere in your code. Usually with a rec.GET or rec.FIND statement.
If you don't retrieve the record value, your record-variable will be empty.

I don't know where to put these statements in your report, as I don't have
enough information. Try the OnAfterGetRecord-trigger for the dataitem you are
using in your report.

Luc Van Dyck
webmaster http://mibuso.com