I have been trying to create documentation that produces a report using a custom query.
I created a template fragment, and added the following query to that fragment by right-clicking in the fragment's body > File > Document Options > Custom Query > Custom SQL:
with relevant_packages as (
select package_id,
name,
parent_id,
convert(varchar(max), '') as parent_name
from t_package
where package_id = 16241
union all
select p.package_id,
p.name,
p.parent_id,
convert(varchar(max), r.name) as parent_name
from t_package p
join relevant_packages r
on r.package_id = p.parent_id
)
select r.package_id,
r.name as package_name,
r.parent_id as parent_package_id,
r.parent_name as parent_package_name,
o.object_id as element_id,
o.name as element_name,
o.stereotype,
o.note,
o.author,
o.createddate
from t_object o
join relevant_packages r
on o.package_id = r.package_id
and o.object_type <> 'Package'
where o.createddate >= convert(datetime, '2015-10-20')
order by o.createddate desc;
I have tested this query in SQL Server Express, and can confirm that it does return records.
I then created another template, added sections, and added the SQL fragment by right-clicking in sections on the template body (I have tried adding the fragment to sections package & element) as described in the linked article:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/reporting/adding_fragments_to_a_template.htmlI then save the template, and generate documentation using that template, output to RTF. The document generated is blank each time.
Can anyone tell me what I'm doing wrong?
Thanks in advance!