PB 11.0
We have Sorting and Filtering enabled for a datawindow via the following (in the constructor)
// SORT
THIS.of_SetSort(TRUE) // SET SERVICE ON
THIS.inv_sort.of_SetExclude(ls_sort_exclude) // EXCLUDE items from the DropDown List
THIS.inv_sort.of_SetColumnHeader(TRUE) // USE COLUMN HEADINGS
THIS.inv_sort.of_SetColumnDisplayNameStyle(2) // USE HEADER NAMES
THIS.inv_sort.of_SetStyle(3) // USE SIMPLE SORT BOX
THIS.inv_sort.of_SetVisibleOnly(TRUE) // SET ON
THIS.inv_sort.of_SetUseDisplay(TRUE) // USE DISPLAY COLUMN FOR CLICK SORT
// FILTER
THIS.of_SetFilter(TRUE) // SET SERVICE ON
THIS.inv_filter.of_SetExclude(ls_filter_exclude) // EXCLUDE items from the DropDown List
THIS.inv_filter.of_SetColumnDisplayNameStyle(2) // USE HEADER NAMES
THIS.inv_filter.of_SetStyle(2) // USE SIMPLE FILTER BOX
THIS.inv_filter.of_SetVisibleOnly(TRUE)
The Sort and Filter dialogs are launched via pfc_sortdlg() and pfc_filterdlg() when appropriate buttons are clicked.
The Sort dialog functions as expected and produces correct sorted results. However, if I click on the sort button again, when the Sort Dialog comes up, it does NOT display the previous Sort criteria and sorting of our report does not work.
On our other screens, the Sort Dialog always displays the previous sort (in the same window instance) and it does not exhibit sort issues with the report.
Below is the code where the sort is applied to the report.
//----------------------------------------------
String ls_Sort , ls_Filter
ls_Sort = tab_1.tabpage_3.dw_master.Object.Datawindow.Table.Sort
ls_Filter = tab_1.tabpage_3.dw_master.Object.Datawindow.Table.Filter
n_ds lds_grid_print
lds_grid_print = Create n_ds
lds_grid_print.DataObject = 'd_sq_tb_pend_open_gr'
lds_grid_print.of_SetTransObject(SQLCA)
lds_grid_print.Retrieve()
//Set filter rules
lds_grid_print.SetFilter(ls_filter)
//Set SORT rules
lds_grid_print.SetSort(ls_sort)
//Make Filter
lds_grid_print.Filter()
//Make Sort
lds_grid_print.Sort()
//Print
lds_grid_print.Print()
//Clean House
Destroy lds_grid_print
//----------------------------------------------
It seems like the Sort data is not being maintained and I cannot figure out why. Is there somewhere that I need to store the sort criteria or a checkbox to enable this?
I appreciate any comments/suggestions.
Thanks
We have Sorting and Filtering enabled for a datawindow via the following (in the constructor)
// SORT
THIS.of_SetSort(TRUE) // SET SERVICE ON
THIS.inv_sort.of_SetExclude(ls_sort_exclude) // EXCLUDE items from the DropDown List
THIS.inv_sort.of_SetColumnHeader(TRUE) // USE COLUMN HEADINGS
THIS.inv_sort.of_SetColumnDisplayNameStyle(2) // USE HEADER NAMES
THIS.inv_sort.of_SetStyle(3) // USE SIMPLE SORT BOX
THIS.inv_sort.of_SetVisibleOnly(TRUE) // SET ON
THIS.inv_sort.of_SetUseDisplay(TRUE) // USE DISPLAY COLUMN FOR CLICK SORT
// FILTER
THIS.of_SetFilter(TRUE) // SET SERVICE ON
THIS.inv_filter.of_SetExclude(ls_filter_exclude) // EXCLUDE items from the DropDown List
THIS.inv_filter.of_SetColumnDisplayNameStyle(2) // USE HEADER NAMES
THIS.inv_filter.of_SetStyle(2) // USE SIMPLE FILTER BOX
THIS.inv_filter.of_SetVisibleOnly(TRUE)
The Sort and Filter dialogs are launched via pfc_sortdlg() and pfc_filterdlg() when appropriate buttons are clicked.
The Sort dialog functions as expected and produces correct sorted results. However, if I click on the sort button again, when the Sort Dialog comes up, it does NOT display the previous Sort criteria and sorting of our report does not work.
On our other screens, the Sort Dialog always displays the previous sort (in the same window instance) and it does not exhibit sort issues with the report.
Below is the code where the sort is applied to the report.
//----------------------------------------------
String ls_Sort , ls_Filter
ls_Sort = tab_1.tabpage_3.dw_master.Object.Datawindow.Table.Sort
ls_Filter = tab_1.tabpage_3.dw_master.Object.Datawindow.Table.Filter
n_ds lds_grid_print
lds_grid_print = Create n_ds
lds_grid_print.DataObject = 'd_sq_tb_pend_open_gr'
lds_grid_print.of_SetTransObject(SQLCA)
lds_grid_print.Retrieve()
//Set filter rules
lds_grid_print.SetFilter(ls_filter)
//Set SORT rules
lds_grid_print.SetSort(ls_sort)
//Make Filter
lds_grid_print.Filter()
//Make Sort
lds_grid_print.Sort()
lds_grid_print.Print()
//Clean House
Destroy lds_grid_print
//----------------------------------------------
It seems like the Sort data is not being maintained and I cannot figure out why. Is there somewhere that I need to store the sort criteria or a checkbox to enable this?
I appreciate any comments/suggestions.
Thanks