package view type ReportViewModel struct { Total string CardTotal string BookingFees string PlatformFees string Fee string Profit string PdfUrl templ.SafeURL Lines []*ReportLine } type ReportLine struct { Id string Url templ.SafeURL Total string CustomerName string From string To string Platform string PlatformFees string Fee string Profit string } templ ReportSection(report *ReportViewModel) {

Your report

Create PDF
for _, row := range report.Lines { }
ID Name From To Revenue (€) Platform Platform Fees (€) Fees (€) Profit (€)
{ row.Id } { row.CustomerName } { row.From } { row.To } { row.Total } { row.Platform } { row.PlatformFees } { row.Fee } { row.Profit }
Totals { report.Total } { report.PlatformFees } { report.Fee } { report.Profit }
Card-only: { report.CardTotal } Booking-only: { report.BookingFees }
}