hi,
you should first create the datawindow in datawindow-painter in PB. then export ist do tisk from librarypaynter and then analyse the syntax. from that you can get the correct syntax.
syntaxfromsql returns a string containing the syntax for dw.create() but cannot handle groups. before creating the dw you need to manipulate the sysntax manually or in a script.
ls_dw_create = sqlca.syntaxfromsql( "select ....", "Style=(type=group) group( 1 2)", errors)
group(1 2) means the dw isgrouped by coumn 1 (first group) column 2(second group)
this creates syntx for freestyle dw always.
change the processing property in the ls_dw_create from processing=0 to processing=1
unfortunatly you have to change in ls_dw_syntax also all columns x,y and width property to correct values. how to do that you can get the information from the exported grid example dw with groups.
I hope this helps
Bernd