diff --git a/src-modules/module/rpta/masken/48000_maskeninfo.unl b/src-modules/module/rpta/masken/48000_maskeninfo.unl index 976a80c..2abb834 100644 --- a/src-modules/module/rpta/masken/48000_maskeninfo.unl +++ b/src-modules/module/rpta/masken/48000_maskeninfo.unl @@ -173,4 +173,9 @@ Column CID=0 heading_text="${column.caption}" center_heading explanation="${colu width=${column.visible_width} text_size=60\ \ \ +<#if 1=0>\ +Column CID=0 heading_text="sortnr" center_heading explanation=""\ + row_selectable heading_platform readonly\ + width=5 text_size=60\ +\ @@@^Studienfach^Anzahl bzw. Anteil^Datenblatt Studierendenstatistik^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^2^850^540^^1^<>SELECT description FROM rpta_column_layout where tid=<>;^ diff --git a/src-modules/module/rpta/schluesseltabellen/fm_templates.unl b/src-modules/module/rpta/schluesseltabellen/fm_templates.unl index 814f495..0f17ee2 100644 --- a/src-modules/module/rpta/schluesseltabellen/fm_templates.unl +++ b/src-modules/module/rpta/schluesseltabellen/fm_templates.unl @@ -269,6 +269,7 @@ drop TABLE tmp_rpta_column2layout;\ \ <#macro rpta_interpret_column_layout nonvirtualTableFilter>\ <#assign columnLayoutHasTreeColumn=0 />\ +\ <#assign treeColumnSrcFieldname="" />\ <#assign treeColumnTargetFieldname="" />\ <#assign treeColumnMaskFieldname="" />\ @@ -361,6 +362,8 @@ drop TABLE tmp_rpta_column2layout;\ where 1=1\ ;\ <#if columnLayoutHasTreeColumn==1>\ + <#assign columnLayoutWithTreeColumnAdditionalGrouping=sichtHasAdditionalGrouping(treeColumnTargetFieldname) />\ +\ --Sichtaufbau:\ --Zuerst leere Zieltabelle anlegen:\ select \ @@ -389,7 +392,7 @@ drop TABLE tmp_rpta_column2layout;\ \ <#foreach einElement in .vars[treeColumnMaskFieldname].elements>\ <@addcomment "${einElement.name}"/>\ - <#if einElement.level < maxEbene >\ + \ --zuerst Summenzeile:\ <#assign sortnr=sortnr+1>\ insert into tmp_stud3(\ @@ -416,13 +419,16 @@ drop TABLE tmp_rpta_column2layout;\ null::char(1),\ \ \ - (${einElement.level}*10000) + ${sortnr} as sortnr\ + --(${einElement.level}*10000) + ${sortnr} as sortnr\ + ${sortnr} *10000 as sortnr\ from tmp_stud2\ where ${treeColumnSrcFieldname} in ${einElement.subkeys}\ \ ;\ - \ - --dann darunter die Werte:\ + \ + --Unterste Ebene die Werte:\ + <#if columnLayoutWithTreeColumnAdditionalGrouping != "" \ + && einElement.level == maxEbene >\ <#assign sortnr=sortnr+1>\ insert into tmp_stud3(\ <#foreach column in columns>\ @@ -434,7 +440,7 @@ drop TABLE tmp_rpta_column2layout;\ <#if column.targetfieldname=treeColumnTargetFieldname>\ '${einElement.name}',\ <#elseif column.targetfieldname="ebene">\ - <#if einElement.level < maxEbene >\ + <#if einElement.level == maxEbene >\ ${einElement.level+ 1},\ <#else>\ ${einElement.level},\ @@ -452,11 +458,12 @@ drop TABLE tmp_rpta_column2layout;\ ${column.targetfieldname},\ \ \ - (${einElement.level}*10000) + ${sortnr} as sortnr\ + ${sortnr} *10000 --(${einElement.level}*10000) + ${sortnr} as sortnr\ from tmp_stud2\ where s_tid_stg in ${einElement.subkeys}\ - group by ca12staat_str\ + group by ${columnLayoutWithTreeColumnAdditionalGrouping}\ ;\ + \ \ \ drop table tmp_stud2;\ @@ -508,6 +515,18 @@ drop TABLE tmp_rpta_column2layout;\ \ \ \ +<#function sichtHasAdditionalGrouping treeColumnTargetFieldnameParam>\ +<#assign ret="" />\ + <#foreach column in columns>\ + <#if column.targetfieldname !=treeColumnTargetFieldnameParam\ + && column.targetfieldname!="ebene"\ + && column.is_aggregate==0 \ + >\ + <#assign ret=column.targetfieldname />\ + \ + \ + <#return ret />\ +\ <#macro rpta_column_fuellen>\ CREATE temp TABLE tmp_rpta_column\ (\