Hi all,
I have Exported data to excel and sorted the data in excel from nav itself. The data was sorted ascending, But i want the data in descending order. Any idea? Please need help.
Created a function in Excel Buffer table for sorting
Function SortColumn(StartColumn:code;StartRow:Integer;EndColumn:Code;EndRow:Integer;SortColumn:Code);
BEGIN
XlWrkSht.Range(StartColumn+FORMAT(StartRow-1)).Select;
XlApp.ActiveWindow.FreezePanes := TRUE;
XlWrkSht.Range(StartColumn+FORMAT(StartRow) + ‘:’+EndColumn+FORMAT(EndRow-1)).Sort(XlWrkSht.Range(SortColumn+FORMAT(StartRow)));
END;
And in report, after calling the CreateSheet and before the GiveUserControl you should execute something like:
SortColumn(‘A’,2,‘Z’,65000,‘B’);
to freeze panes and sort the column B from row 2 and on…
Refference: viewtopic.php?f=23&t=18606&start=0