Navision Export To Excel with Merge Cell Function

Hi all,

While developing reports in classic client with Export to Excel Enabled, client wants to have Header cell merged. This is mostly faced issue.

Resolution -
What i did is that i added a function in Excel Buffer table which merge specified cell.

Function -

PROCEDURE MergeRange(FromRow : Integer;FromCol : Integer;ToRow : Integer;ToCol : Integer);
VAR
  FromRec : Record 370;
  ToRec : Record 370;
BEGIN
  FromRec.VALIDATE("Row No.",FromRow);
  FromRec.VALIDATE("Column No.",FromCol);
  ToRec.VALIDATE("Row No.",ToRow);
  ToRec.VALIDATE("Column No.",ToCol);
  XlWrkSht.Range(FromRec.xlColID + FromRec.xlRowID + ':' + ToRec.xlColID + ToRec.xlRowID).Merge;
END;

Read Complete Article »