View Categories

Template for creating a CCL layout program

1 min read

In this article, we will describe an example of a layout program in DiscernVisualDeveloper. You can find the CCL program AUDIT_LOCATIONS attached to this article. The purpose of the layout program AUDIT_LOCATIONS is to be used as a template or example for creating CCL layout programs. Although it is simple, it contains basic elements that are commonly used in layout programs. Instead of creating new layout programs from scratch, you can import this program into DiscernVisualDeveloper and modify it every time you need to create a new layout program.

We will describe what data the layout program AUDIT_LOCATIONS display, how the program is structured, and finally, how you can install and run it.

What data does AUDIT_LOCATIONS display #

The layout program AUDIT_LOCATIONS obtains core locations and displays them in the format of a report (as opposed to a grid). It includes the outbound aliases of the locations for a contributor source called ADT.

The output of the program looks like this:

Structure of AUDIT_LOCATIONS #

AUDIT_LOCATIONS has two components:

  • sample_data.inc
  • audit_locations.dvt

The include script sample_data.inc obtains and stores in a record the data to be displayed in the report. It uses a main query to obtain and store the facilities, buildings and units. Once the record is filled, it loops over the record to add additional data (location aliases).

The layout program audit_locations.dvt displays the data stored in the record. It is divided into different sections:

  • Head Page: colum headers at the top of every page
  • Head D1.SEQ: facility details
  • Head D2.SEQ: buildings of each of the facilities
  • Head D3.SEQ: units of each of the buildings
  • Detail: empty (not used)
  • Head D1.SEQ: horizontal line after each facility
  • Foot page: a horizontal line to identify the footer and Page X of Y.

The following query is used to iterate through the record:

SELECT INTO "NL:"
FROM
	(DUMMYT   D1  WITH SEQ = VALUE(SIZE(data->facility_qual, 5)))
	, (DUMMYT   D2  WITH SEQ = 1)
	, (DUMMYT   D3  WITH SEQ = 1)

PLAN D1 WHERE MAXREC(D2, SIZE(data->facility_qual[D1.SEQ].building_qual, 5))
JOIN D2 WHERE MAXREC(D3, SIZE(data->facility_qual[D1.SEQ].building_qual[D2.SEQ].unit_qual, 5))
JOIN D3

ORDER BY
	D1.SEQ
	, D2.SEQ
	, D3.SEQ

WITH NOCOUNTER

Installation instructions #

You need to download the audit_locations.dvt file to a location you can access from DiscernVisualDeveloper. Once you have opened DiscernVisualDeveloper, you can import the audit_locations.dvt file (from the file menu option).

Please be sure that file sample_data.inc is on all back-end nodes for the domain you are working in. It should be stored in the directory specified in the Execution Flow section:  

In this example, the layout program is searching for the sample_data.inc file in $CCLUSERDIR.

How to manually run layout program #

You can run the report from within DiscernVisualDeveloper:

Powered by BetterDocs

This site uses cookies to function and analyze usage. By accepting, you consent to their use and data processing.    Know More
Privacidad