use autogenerated functions for reports
fix template and regenerate code