Для формирования отчётов были разработаны запросы к БД, запросы
реализованы в модуле uReport. Ниже представлены запросы для всех отчётов.
Для отчёта о графике медосмотров за период требуется запрос:
«select
convert(varchar,s.sDate,104) +' '+ isNull(s.Description,'') as [Осмотр]
,isNull(pr.FIO,'Не начинался') as [Работник]
,case when isNull(r.Name,'''')='''' then '''' else isNull(r.Name,'''') end as [Причина]
,case when isNull(pr.FIO,'''')='' then '''' else (case when isNull(p.PassEnd,0)=1
then '' Пройдено'' else ''Не пройдено'' end) end as [Пройдено]
from Schedule s
left join Pass p on p.Schedule=s.ID
left join Personal pr on pr.ID=p.Personal
left join Reason r on r.ID=p.Reason».
Для отчёта о графике проверок за период требуется запрос:
«select
convert(varchar,s.sDate,104) +' '+ isNull(s.Description,'') as [Проверка]
,isNull(pr.FIO,'Не начинался') as [Работник]
,case when isNull(r.Name,'''')='''' then '''' else isNull(r.Name,'''') end as [Причина]
,case when isNull(pr.FIO,'''')='' then '''' else (case when isNull(p.PassEnd,0)=1
then '' Пройдено'' else ''Не пройдено'' end) end as [Пройдено]
from Schedule s