DYNGRID (CVSCOLUMN)

I found it very useful to use the CVSCOLUMN under a TEXTGRIDSSS. I am using this under Natpages from a Natural program.

The advantages are that I can define grids dynamically in my program and change the layouts depending on what my needs are. I can therefore reuse one grid definition many times. A great time saver.

However, when I click the sort icon on the header, I get the following error.

java.lang.Error: Error accessing object of class com.softwareag.cis.adapter.ndo.NDOTEXTGRIDCollection$NDOCSVItem with accessPath

Is the problem that with dynamic grids one cannot sort the column data?

Is this version NJX123? Sorting for cvscolumns in NATPAGES was not properly supported in earlier versions. But in NJX123 it should work correctly.

Best Regards,
Christine

It is versoin NJX123. I am not sure if I am setting up the columns correctly in my Natural program though. Below is a snippet of code from the program. I am not sure about DYNSORTTITLEPROP. Apology - the indentation in the program seems to be lost when posting here.

READ DCSE-ENFORCEMENT BY SP-PERSON-DAT9-REMEDY
STARTING FROM #SP-PERSON-DAT9-REMEDY.SP-PERSON-DAT9-REMEDY

IF DCSE-ENFORCEMENT.ID-PERSON NE DCSE-CASE.ID-PERSON-NCP
ESCAPE BOTTOM
END-IF
ADD 1 TO #READ-COUNT
INCLUDE QFCC0020 ‘235’ ‘DCSE-ENFORCEMENT.CD-ENF-REMEDY’ ‘FIELD1’
INCLUDE QFCC0020 ‘234’ ‘DCSE-ENFORCEMENT.CD-STAT’ ‘FIELD2’
COMPRESS
FIELD1 ‘;’
FIELD2 ‘;’
DCSE-ENFORCEMENT.DATE-BEG ‘;’
DCSE-ENFORCEMENT.DATE-END ‘;’
DCSE-ENFORCEMENT.ID-CASE
INTO DYNGRID.DYNGRIDVALUES (#READ-COUNT)
END-READ
IF #READ-COUNT > 0
MOVE ‘Enforcement’ TO FOLDEDNAMEPROP
MOVE TRUE TO FOLDEDVISIBLEPROP
MOVE FALSE TO FOLDEDPROP
MOVE ‘Remedy;Status;“Beg Date”;“End Date”;Case’ TO DYNGRIDTITLES
MOVE ‘250;250;70;70;100’ TO DYNGRIDWIDTHS
MOVE ‘;;;;’ TO DYNPROPREFPROP
MOVE ‘;;;;’ TO DYNTITLESORTPROP
MOVE ‘left;left;left;left;left’ TO DYNALIGNSPROP
REDUCE ARRAY DYNGRID TO (1:#READ-COUNT)
END-IF

The missing proprefsprop property is the reason for the error you get at runtime. You don’t have to specify a sorttitleprop.
Example layout snippet:

<csvcolumn titlesprop="mytitles" valuesprop="myvalues" widthprop="mywidth" proprefsprop="myproprefs" 

In your Natural code you must assign a comma separated list of names to the corresponding MYPROPREFS data field.
Example for a grid with 3 columns:

MOVE 'mycol1;somecol2;anothercol3' TO MYPROPREFS

If you want you can of course additionally specify a sorttitleprop. Example for a grid with 3 columns:

MOVE 'Sorttext1;Sorttext2;Sorttext3' TO MYSORTTITLES

The sorttitles appear as tooltips when your mouse is over the little sort icons.

Best Regards,
Christine

Thanks Christine - works perfectly now.

Best regards

Demos