newLeadingSubSummaryPart

Questions, tips and tricks and techniques for scripting in Servoy

newLeadingSubSummaryPart

Postby Marco R. » Tue May 12, 2009 12:49 pm

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.

Code: Select all
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
Marco Rossi
Freelance

Main development environment: Servoy 6.1.6 - 7.4.3, Java 1.6u45,7u71 Windows 7/CentOS
Marco R.
 
Posts: 203
Joined: Thu Mar 19, 2009 12:37 pm

Re: newLeadingSubSummaryPart

Postby lvostinar » Tue May 12, 2009 1:48 pm

Code: Select all
_form_part_subS.groupbyDataProviderIDs = true;


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

Code: Select all
_form_part_subS.groupbyDataProviderIDs = 'id,test';
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am


Return to Methods

Who is online

Users browsing this forum: No registered users and 35 guests

cron