# newLeadingSubSummaryPart

**URL:** <https://forum.servoy.com/t/newleadingsubsummarypart/10643>\
**Category:** Classic Servoy\
**Created:** [May 12, 2009, 10:49am UTC](https://forum.servoy.com/t/newleadingsubsummarypart/10643 "2009-05-12T10:49:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_R](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Marco\_R](https://forum.servoy.com/u/Marco_R)\
**Post date:** [May 12, 2009, 10:49am UTC](https://forum.servoy.com/t/newleadingsubsummarypart/10643/1 "2009-05-12T10:49:14Z")

</div>

Hi,

I need to do a report of a form based on a dataset(by solutionModel)  
The result of Query are just grouped by the first column.

My problem is the following:

When I use the method “newLeadingSubSummaryPart” I not be able to set the “GroupBy-fields” property like the tab “parts” into ‘Form Design’ perspective.  
Then when I launch the print-preview of my form,the result is two white pages. The same working can be viewed with the normal form when the “GroupBy-fields” are not specified.

p.s. I have just tried to set the ‘rowIndex’ property of my Dataset before create the datasource and then put ‘true’ into ‘.groupbyDataProviderIDs’ properties of the Part but It doesn’t work.

```auto
globals.FormDatasource =databaseManager.getDataSetByQuery(server,query, null, -1);
globals.FormDatasource.rowIndex = 1
var uri = globals.FormDatasource.createDataSource('mydata2', [DM_COLUMNTYPE.INTEGER,DM_COLUMNTYPE.NUMBER, DM_COLUMNTYPE.NUMBER]);
jsform = solutionModel.newForm('myForm', uri,'myTable' ,true, 400,150);
      
var _form_part_subS = jsform.newLeadingSubSummaryPart(140)
_form_part_subS.groupbyDataProviderIDs = true;
 		
var jsFieldFirstColumn = jsform.newTextField(globals.FormDatasource.getColumnName(1),100,50,199,20);
var jsFieldSecondColumn = jsform.newTextField(globals.FormDatasource.getColumnName(2),100,80,199,20);
var jsFieldThirdColumn = jsform.newTextField(globals.FormDatasource.getColumnName(3),100,110,199,20);
 jsFieldFirstColumn.text=globals.FormDatasource.getColumnName(1)
 jsFieldSecondColumn.text=globals.FormDatasource.getColumnName(2)   	
 jsFieldThirdColumn.text=globals.FormDatasource.getColumnName(3)  
 
 forms['myForm'].controller.loadAllRecords()
 forms['myForm'].controller.showPrintPreview(false,null,125)

```

What i have to do to make it work?

Regards

Marco

---

<div class="post-metadata">

**Author:** ![lvostinar](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/lvostinar/32/5248_2.png) [@lvostinar](https://forum.servoy.com/u/lvostinar)\
**Post date:** [May 12, 2009, 11:48am UTC](https://forum.servoy.com/t/newleadingsubsummarypart/10643/2 "2009-05-12T11:48:29Z")

</div>

```auto
_form_part_subS.groupbyDataProviderIDs = true;

```

this is not correct, you should put comma separated dataprovider ids like:

```auto
_form_part_subS.groupbyDataProviderIDs = 'id,test';

```
