Options

Who can provide a tutorial for integer DataItem?

clement_blueclement_blue Member Posts: 16
After I study all the topics about the 'Integer' DataItem in this forum, I still cannot fully understand how to use it...

Who can provide me a tutorial for the following scenario:
1) I already create a DataItem (Customer)
2) How to use Integer DataItem to display a message ("Show message") 3 times after each record is received.

I did try to use one Iteger DataItem to do the above scenario, but it only show the message one time...
In Integer DataItem,
1) I write SETRANGE(Number,1,3); in OnPreDataItem().
2) and I write MESSAGE(Customer."No."); in OnAfterGetRecord.

Can anyone correct my code?
Thank you.

Comments

  • SnoopySnoopy Member Posts: 43
    I don't know, if you use a report or a dataport.

    1. define a variable i as integer - in OnPreDataItem define i := 0;
    2. In the OnAfterGetRecord-Trigger:

    i += 1;
    if i = 3 then begin
    message ...
    i := 0;
    end;

    Another way is:
    i+= 1;
    If i mod 3 = 0 then
    message
  • clement_blueclement_blue Member Posts: 16
    Sorry...I know the way u mention. But....
    I wonder know how to use Integer(Virtual Table) DataItem to show the message.
    Because I wanna learn to use the Integer DataItem.
  • Sophia_SinghSophia_Singh Member Posts: 42
    Hi!!!!!!!!!!
    Indent Integer dataitem below customer..........
    OnPredataitem (of Integer)

    IF Number <= 3 THEN
    Number := 1;
    SETRANGE(Number,1,3);

    OnAfterGet Record(of Integer)

    If Number <= 3 THEN
    message('Customer."No." = %1',Customer."No.");

    regards,
    Sophia
  • DenSterDenSter Member Posts: 8,307
    There's really no need for any code at all. I'm not going into whether the usage of an integer dataitem is the proper solution here, which I am not convinced that it is. I'd propably think about a footer with a few labels with the messages before adding an integer dataitem.

    Add the integer dataitem indented under your other dataitem, and define the DataItemTableView as "SORTING(Number) WHERE(Number=FILTER(1..3))". Then all you need to do is add a body section for the Integer dataitem, and you are done. The only coding you would need is to change the message.
Sign In or Register to comment.