public Sample2Model Map(IEnumerable<Customer> customers) { var model = new Sample2Model(); model.Title = "Sample 2 Report"; foreach (var customer in customers) { model.Details.Add(new Sample2DetailModel { CustomerName = customer.Name, Address = customer.Address, City = customer.City, State = customer.State, Zip = customer.Zip, OutstandingBalance = customer.OutstandingBalance(), PreviousPaymentTotal = customer.PreviousPaymentTotal, PreviousChargeTotal = customer.PreviousChargeTotal }); } return model; }
public byte[] Render(Sample2Model model) { var parameters = new List<ReportParameter>(); parameters.Add(new ReportParameter("Title", model.Title)); return new PdfRenderer().Render(ReportName.Sample2, "Model", model.Details.ToArray(), parameters.ToArray()); }