public SampleModel Map(IEnumerable<Customer> customers)
        {
            var model = new SampleModel();
            model.Title = "Sample Report";

            foreach (var customer in customers)
            {
                model.Details.Add(new SampleDetailModel
                                      {
                                          CustomerName = customer.Name,
                                          Address = customer.Address,
                                          City = customer.City,
                                          State = customer.State,
                                          Zip = customer.Zip,
                                          OutstandingBalance = customer.OutstandingBalance(),
                                          PreviousPaymentTotal = customer.PreviousPaymentTotal
                                      });
            }

            return model;
        }
Ejemplo n.º 2
0
 public byte[] Render(SampleModel model)
 {
     var parameters = new List<ReportParameter>();
     parameters.Add(new ReportParameter("Title", model.Title));
     return new PdfRenderer().Render(ReportName.Sample, "Model", model.Details.ToArray(), parameters.ToArray());
 }