grouping disappears on report

Hi all

I currently have a form based on one of my tables (fabric_condition) with no related fields from other tables.

I have a leading sub summary into which i have placed two fields, cd_complex and cd_plant on which i have specified grouping.
Within the body i have various fields containing textual data.
The initial sort on the form is by cd_complex asc and then by cd_plant asc.
The form is set up to go straight into print preview onShow.

If i launch my solution but dont touch any forms and just hit ctrl + L to print preview my report, it displays just fine ie a leading summary containing complex and plant with a list of the various other fields below in the body.
This is then repeated for each complex/plant as it should be.

If however i hook the form up to be launched via a button from another form within my solution, the print preview output no longer displays the grouped fields, ie i just get the body of the form, with no leading summary.

Could anyone shed any light on this behaviour.

Regards

Solved (Reply on behalf of McCourt).

Robert Ivens (once again) helped us understand some of the nuances of Servoy code. For anyone else suffering now or in the future:

  1. Create the form to print.
  2. Create Leading SubSummary Part.
  3. Add Cols to summary and body.
  4. Ensure the Leading SubSummary part has the columns there set to group by.
  5. In the code to call the PrintPreview - add ‘controller.sort(‘your_colum1 asc, your_column2 asc’)’ as shown in your group by box.

Our mistake was not figuring out the format for the sort string?

Wrong > forms.test_frm_rpt.controller.sort(‘cd_complex asc’, ‘cd_plant asc’)
Right > forms.test_frm_rpt.controller.sort(‘cd_complex asc, cd_plant asc’)

Seems like a small error but caused us a major problem for a few days!