Berichtsassistent
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

109 lines
3.8 KiB

48110^Leistungen und Studiengänge^--Freemarker Template\
<#include "SQL_lingua_franca"/>\
<#include "SuperX_general"/>\
--\
--Autor D. Quathamer 2024\
<sqlvars>\
<sqlvar name="basetable" type="hash"><![CDATA[\
<#assign my_base_rs='rpta_exam_unit_dim_studiengang' />\
SELECT distinct name,\
0::smallint as is_virtual,\
name as runtime_tablename\
from sx_tables\
where name in ('${my_base_rs}')\
and 0=(select count(*) from rpta_resultset R where R.uniquename='${my_base_rs}')\
union\
select R.uniquename,\
1::smallint as is_virtual,\
'tmp_' || R.uniquename as runtime_tablename\
from rpta_resultset R where R.uniquename='${my_base_rs}'\
;\
]]>\
</sqlvar>\
<sqlvar name="rpta_resultset" type="hash"><![CDATA[\
select caption,\
uniquename,\
fieldclause,\
joinclause,\
whereclause,\
systeminfo_id\
from rpta_resultset\
where uniquename='${basetable.name}';\
\
]]></sqlvar>\
<sqlvar name="rpta_column_layout" type="hash"><![CDATA[\
select L.uniquename,\
L.caption,\
L.whereclause\
from rpta_resultset R, rpta_column_layout L\
where L.resultset_id=R.tid\
and R.uniquename='${basetable.name}'\
and L.uniquename=<<Spaltenlayout>>;\
\
]]></sqlvar>\
<sqlvar name="columns" type="hashsequence"><![CDATA[\
SELECT C.srcfieldname,\
(case when string_not_null(C.targetfieldname)='' then C.srcfieldname else C.targetfieldname end) as targetfieldname,\
T.uniquename as coltype,\
C.is_aggregate,\
(case when string_not_null(CL.caption)='' then C.caption else CL.caption end) as caption,\
CL.is_visible,\
CL.visible_size as visible_width,\
(select F.sql_code from rpta_format_code F where F.tid=CL.format_code_id) as format_sql,\
C.col_function as colfunction,\
(case when string_not_null(CL.description)='' then C.description else CL.description end) as description\
FROM rpta_column_layout L, rpta_column2layout CL, rpta_column C, rpta_column_type T\
where L.tid=CL.layout_id\
and C.tid=CL.column_id\
and T.tid=C.column_type\
and L.uniquename=<<Spaltenlayout>>\
/* and C.uniquename in (<<Spalten>>) */\
order by CL.sortnr\
;\
]]></sqlvar>\
</sqlvars>\
\
<#assign filter="1=1\
/* and sem_der_pruefung >= <<Seit Semester>> */\
/* and sem_der_pruefung <= <<Bis Semester>> */\
/* and sem_der_pruefung = <<Semester>> */\
/* and substring('' || sem_der_pruefung from 5 for 1)='<<Semestertyp>>' */\
/* and fach_sem_zahl <= <<bis Fachsemester>> */\
" />\
\
<#assign filter = filter + " and 's_' || tid_stg in "+Studiengang.allNeededKeysList /> \
<#assign filter = filter + " and tid_stg in (select tid from lehr_stg_ab where stg in "+Fächer.allNeededKeysList +")"/> \
\
<#if columns?has_content>\
\
<#if basetable.is_virtual==1>\
\
create temp table ${basetable.runtime_tablename} as\
select ${rpta_resultset.fieldclause} \
from ${rpta_resultset.joinclause} \
where 1=1\
<#if rpta_resultset.whereclause != ""> \
${rpta_resultset.whereclause} </#if>\
and ${filter}\
;\
</#if>\
\
\
\
<@rpta_interpret_column_layout />\
\
\
</#if> --wenn columns?has_content^--Freemarker Template\
XIL List\
sizable_columns horizontal_scrolling\
drop_and_delete movable_columns \
white_space_color=COLOR_WHITE fixed_columns=1\
min_heading_height=55\
<#foreach column in columns>\
<#if column.is_visible!=0>\
Column CID=0 heading_text="${column.caption}" center_heading explanation="${column.description}"\
row_selectable heading_platform readonly\
width=${column.visible_width} text_size=60\
</#if>\
</#foreach>\
@@@^Studienfach^Anzahl bzw. Anteil^Leistungen und Studiengänge^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^2^850^540^^1^<<SQL>>SELECT description FROM rpta_column_layout where tid=<<Spaltenlayout>>;^