...
IF ShowColumnName THEN
CaptionFieldNo := DimVal.FIELDNO(Name)
ELSE
CaptionFieldNo := DimVal.FIELDNO(Code);
MatrixMgt.GenerateMatrixData(RecRef,SetWanted,NoOfColumns,CaptionFieldNo,MATRIX_PKFirstRecInCurrSet,MatrixColumnCaptions,
MATRIX_CaptionRange,MATRIX_CurrSetLength);
IF MATRIX_CurrSetLength > 0 THEN BEGIN
...
...
IF ShowColumnName THEN
CaptionFieldNo := DimVal.FIELDNO(Name)
ELSE
CaptionFieldNo := DimVal.FIELDNO(Code);
IF ShowColumnName THEN
MatrixMgt.GenerateMatrixData(RecRef,SetWanted,NoOfColumns,DimVal.FIELDNO(Code),MATRIX_PKFirstRecInCurrSet,MatrixColumnCaptions,
MATRIX_CaptionRange,MATRIX_CurrSetLength);
MatrixMgt.GenerateMatrixData(RecRef,SetWanted,NoOfColumns,CaptionFieldNo,MATRIX_PKFirstRecInCurrSet,MatrixColumnCaptions,
CaptionRange,MATRIX_CurrSetLength);
IF MATRIX_CurrSetLength > 0 THEN BEGIN
...