Lables problem in report

ameenameen Member Posts: 217
Hi to experts,

I am a new bee to navision and coding. I have some problem.
I have 50 items . In that 50 item s 25 items has only Description .
and remaing 25 items has description , height ,lenght, width,.....
In item card i filled all information regarding items.
I created one sales invoice report in that we add lables Desctiption, height, lenght, width, thick ness,.......
what my probelm is when selected a item which has only description to sale in that invoice report include description and remaining lables are coming. I do want like that.
What i want when i select item if it has only description the lables should not come on that report.(thick ness, length, width,)
when i slelect item which has description, lenghth.... at that only lables has to come on sales invoice report.

How can we solve this. Please provide some code to solve this issue.

](*,) ](*,) ](*,)
thanks and regards
ameen

Comments

  • NaviDevNaviDev Member Posts: 365
    Instead of label why dont you use textbox and specify a variable in to it. Then add a code like this.
    If ((Item.Length <> 0) AND (item.Height <> 0) AND (item.Width <> 0) THEN
      //Pass to the variables what string that they show
    ELSE 
      //Clear the textbox variable here
    
    Navision noob....
  • ameenameen Member Posts: 217
    Thank U NaviDev,


    I am a new bee to navision and learning programming. I am not super programmer like u. I am requesting put some code to solve this issue.
    Give some code. ](*,) ](*,)
    i will be very grateful to u.

    thanks and regards
    ameen
  • matttraxmatttrax Member Posts: 2,309
    You should have two sections in your report, one with all of the labels, and one with only the description.

    In the one with all the labels you need to add code to the OnPreSection trigger. CurrReport.SHOWOUTPUT( (Height <> 0) and (Weight <> 0) and (Thickness <> 0));

    Or whatever variables you are using.

    In the other section you will do the oppositte

    CurrReport.SHOWOUTPUT( (Height = 0) OR (Weight = 0) OR (Thickness = 0));

    You should get the idea.
  • NaviDevNaviDev Member Posts: 365
    ameen wrote:
    Thank U NaviDev,


    I am a new bee to navision and learning programming. I am not super programmer like u. I am requesting put some code to solve this issue.
    Give some code. ](*,) ](*,)
    i will be very grateful to u.

    thanks and regards

    Ex.
    - Declare a global variable named it txtHeight, txtLength and txtWeight.
    - In the section of the report you are modifying. Place 3 textbox where you should view the labels.
    -Change the SourceExpr of each textbox by the variables txtHeight, txtLength and txtWeight.
    -In the OnPreSection trigger of that place a code like this
    If ((Item.Length <> 0) AND (item.Height <> 0) AND (item.Width <> 0) THEN BEGIN
      txtHeight := 'Height';
      txtLength := 'Length';
      txtWeight := 'Weight';
    END ELSE BEGIN
      txtHeight := '';
      txtLength := '';
      txtWeight := '';
    END;
    

    - Save and Run the report.
    Navision noob....
Sign In or Register to comment.