Expand my Community achievements bar.

Problem with Subform set as Overflow Leader wihch has data-bound fields.

Avatar

Level 8

I am using a subform as overflow leader, where it must repeat at the top of every page, if the related group items will cause overflow. The fields are bound to the results of a Web Service Call (WSDL Connection).

The report structure looks as follows:

- Attendance Report

  - Staff List

    - Staff Item 1

      - Staff ID

      - Staff Name

    - Attendnace Details

      - Attendnace Details Day 1

      - Attendnace Details Day 2

      - Attendnace Details Day 3

      ...etc

    - Staff Item 2

      - Staff ID

      - Staff Name

    - Attendnace Details

      - Attendnace Details Day 1

      - Attendnace Details Day 2

      - Attendnace Details Day 3

      ...etc

I found a problem where if the Attendance Details will overflow, then the next page, the Staff Item Details (ID and Name) are printed, but they are blank.

So, I decided to try the following code on the Initialize Event of the Staff Item Subform:


if (StaffId.rawValue == null || StaffId.rawValue=="") {
     var theNodeList = sfStaffItem.resolveNodes("sfStaffItemHeader[*]");
     var theNode = theNodeList.item(0);
     StaffId.rawValue = theNode.StaffId.rawValue;
     StaffName.rawValue = theNode.StaffName.rawValue ;
     Department.rawValue = theNode.Department.rawValue;
     NormalSchedule.rawValue = theNode.NormalSchedule.rawValue;
     RamadanSchedule.rawValue = theNode.RamadanSchedule.rawValue;
}


The above code is working successfully. Basically, the above code is getting the the first instance of the Staff Item Header, which is supposed to be filled properly, and will populate the the current instance if the field values are empty.

But, I just wanted to ask if the problem I faced is expected ?

Is there a better solution ?

Tarke.

0 Replies