How to: make a IF Statement, working after the 1st Dataitem

mgerhartz
mgerhartz Member Posts: 50
Hi there,

I'm also brand new at working with navision. I want to generate my report and have the following problem: the report shouldn't show lines with a value of Zero. I used this statement:

IF (("gesamt abrechenbar" = 0) OR ("gesamt nicht abrechenbar" = 0)) THEN
CurrReport.SHOWOUTPUT (FALSE);

But the result is, that the report doesn't shows the value of the first dataitem. Does anyone has an idea?

Thanks so much!

P.S.: The rest of the report is working very well.

Markus

Comments

  • Shenpen
    Shenpen Member Posts: 386
    Maybe
    ELSE currreport.showoutput(true);
    
    [/code]

    Do It Yourself is they key. Standard code might work - your code surely works.
  • garak
    garak Member Posts: 3,263
    for lazy programmers the not get money for many lines.

    CurrReport.SHOWOUTPUT(not (("gesamt abrechenbar" = 0) OR ("gesamt nicht abrechenbar" = 0)));

    Regards
    Do you make it right, it works too!
  • gzyzz
    gzyzz Member Posts: 5
    Just set the BlankZero property of this field in the report section to YES
  • ara3n
    ara3n Member Posts: 9,258
    But the result is, that the report doesn't shows the value of the first dataitem.

    This means you have mulitple dataitems? Like this

    Dataitem1
    -->DateItem2


    if yes then the first dataitem1 has a property called PrintOnlyIfDetail make sure it's set to false.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • mgerhartz
    mgerhartz Member Posts: 50
    Hey Guys, thank you for your quick help. But I tried everything and the result wasn't the right one. Maybe I haven't give you enought informations. I just want to skip the codeline for the first datarecord. This statement:


    IF gesamt < 1 THEN
    CurrReport.SHOWOUTPUT (FALSE);


    makes, that the line doesn't display, when the value is less than one. And it works fine, but the first record were also doesn't be displayed and it doesn't matter if the value of "gesamt" is more or less than 1.

    That's the reason, why I want to skip the Code for the first record. By the way, this is the DataItem Structure:

    Structure
    >Leistungsart
    >>Zeitaufwand

    And the field "gesamt" is part of the "Leistungsart"-Footer.

    When I tried to use the following statement:

    IF gesamt = 0 THEN
    CurrReport.SKIP
    ELSE;

    I got twice the message: This function works only at the DataItemCode or this function works only at the SectionCode. :-k

    Thanks again for your help and have a nice day....

    Markus
  • mgerhartz
    mgerhartz Member Posts: 50
    Here we are! I found it out for myselfe. This is the only short codepart I missed:


    IF Tempdaten.FIND('-') THEN BEGIN
    IF gesamt = 0 THEN
    CurrReport.SHOWOUTPUT(FALSE)
    END;

    Thanks anyway for your help. Have a great day and byby

    markus \:D/