Inicio del área de contenido

Procedimiento Selecting Fields for Reports Localizar documento en árbol de navegación

Use

The columnNames array contains an entry for each field that is to be displayed in a separate column in a report.

The columnNames array is defined as follows in the model report, CATS_REPORT_01:

private String[] columnNames = {Z_WORKDATE,

   Z_POSID,

   Z_POST1,

   Z_CATSHOURS,

};

The Z_WORKDATE (date of entry), Z_POSID (WBS element), and Z_CATSHOURS (number of hours) fields are contained in the CATS notebook data records. The Z_POST1 field (text describing the WBS element) originates from a picklist and is not contained in the data records.

Prerequisites

You have created your own report based on the model report, CATS_REPORT_01.

Procedure

  1. In your own report, insert into the columnNames array all fields that you want to have displayed in addition to those of the model report.
  2. Remove any fields of the model report that you do not require.
  3. For all fields you added that, for example, originate from a picklist, that is, are not contained in the CATS notebook data records, implement special handling according to the following model. The model relates to the special handling of the Z_POST1 field in the model report, CATS_REPORT_01.

if (columnNames[j].equals(Z_POST1)) {

    try {

        IPicklist picklist = timeSheetReader.getPicklist(Z_POSID);

        String rproj = catsRecord.getFieldAsString(Z_POSID);

        ITableReadOnly picklistRecords = picklist.select(rproj, rproj);

        if (picklistRecords.getRowCount() != 0) {

            String rprojDescription =

            picklistRecords.getRecordReadOnly(0).getFieldAsString(Z_POST1);

          aContext.setValue(RECORDLIST, rprojDescription, index);

        }

  } catch (Throwable e) {

  }

Fin del área de contenido