add avg and sum to pdf_template