Report of filled records

mbosveldmbosveld Member Posts: 8
I would like to create a report of table 5050 (contact).
What I would like to generate, is al list of all the records that are not filled.

I already created a report of table 5050. All the records, that need to be filled are in it. So when i run the report, it prints me all the selected records of the contact table.

I would only like to see the records that are not filled, and if possible, give me that contact Nr.

I already went through my reporting learning book, but cannot find any solution.
Note that I am a rookie, this is my first Live report.
Could anyone please help me on this matter?
Regards,

Comments

  • krikikriki Member, Moderator Posts: 9,118
    First of all : what exactly do you mean with "the records that are not filled"? Records with a blank Name? Records with a blank Name or blank Address? Something else?

    In the first case, you can let the user put a filter '' (=2 single quotes) in the Name field.
    Or you can put it in the property "DataItemTableView"=WHERE(Name=FILTER('')).

    Or you can put a filter in the "OnPreDataItem()" of the dataitem
    SETRANGE(Name,'');
    

    In case you have to test more field (like if Name or Addres is blank), you need to put some code in the "OnAfterGetRecord()"-trigger of the dataitem.
    IF (Name <> '') AND
       (Adress <> '') THEN
      CurrReport.SKIP;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • mbosveldmbosveld Member Posts: 8
    kriki wrote:
    First of all : what exactly do you mean with "the records that are not filled"? Records with a blank Name? Records with a blank Name or blank Address? Something else?

    I mean, that I want to print the records that are blank.
    For Example, contact 1 has been created, but his telephone number is not filled. The record Telephone number is blank

    In my report, i would like to see the Contact nr. (in this case 1), and the field that hasn't been filled (in this case Telephone number).
  • krikikriki Member, Moderator Posts: 9,118
    You need to create a textvariable and put it in the section.
    In this variable we will put the fields that are not filled in.
    This is the code you need in the "OnAfterGetRecord()"-trigger
    txtFields := '';
    IF Name = '' THEN
      txtFields := COPYSTR(txtFields + ',' + FIELDCAPTION(Name),1,MAXSTRLEN(txtFields));
    IF Address = '' THEN
      txtFields := COPYSTR(txtFields + ',' + FIELDCAPTION(Address),1,MAXSTRLEN(txtFields));
    IF Telephone = '' THEN
      txtFields := COPYSTR(txtFields + ',' + FIELDCAPTION(Telephone),1,MAXSTRLEN(txtFields));
    
    // other fields to be tested...
    
    txtFields := COPYSTR(txtFields,2); // this to delete the first ',' in case there is a field
    IF txtFields = '' THEN
      CurrReport.SKIP;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • mbosveldmbosveld Member Posts: 8
    Thanks so far, I think i can get a long way with this info.
Sign In or Register to comment.