예제 #1
0
    static XtraReport CreateCustomerSalesDetailReport(long customerID)
    {
        var report   = new CustomerSalesDetailReport();
        var customer = DataProvider.Customers.FirstOrDefault(c => c.Id == customerID);

        if (customer != null)
        {
            report.SetChartData(QueriesHelper.GetCustomerSaleOrderItemDetails(customer.Id, DataProvider.OrderItems));
            report.DataSource = QueriesHelper.GetCustomerSaleDetails(customer.Id, DataProvider.OrderItems);
        }
        return(report);
    }
예제 #2
0
        XtraReport CreateAndInitializeReport(CustomerReportType reportType)
        {
            var locator = GetService <Services.IReportLocator>();
            var report  = locator.GetReport(reportType) as XtraReport;

            switch (reportType)
            {
            case CustomerReportType.SelectedContactDirectory:
                report.DataSource = CollectionViewModel.SelectedEntity.Employees;
                break;

            case CustomerReportType.ContactDirectory:
                report.DataSource = ViewModel.CustomerEmployees;
                break;

            case CustomerReportType.LocationsDirectory:
                report.DataSource = CollectionViewModel.Entities;
                break;

            case CustomerReportType.SalesDetail:
                var orders = QueriesHelper.GetCustomerSaleDetails(CollectionViewModel.SelectedEntityKey, CollectionViewModel.GetOrderItems());
                //((CustomerSalesDetailReport)report).SetChartData(orders.SelectMany(x => x.OrderItems).ToArray());
                report.DataSource = orders;
                break;

            case CustomerReportType.Profile:
                report.DataSource = new List <Customer> {
                    CollectionViewModel.SelectedEntity
                };
                break;

            case CustomerReportType.SalesSummary:
                report.DataSource = QueriesHelper.GetCustomerSaleOrderItemDetails(CollectionViewModel.SelectedEntity.Id, CollectionViewModel.GetOrderItems());
                break;
            }
            return(report);
        }
 public void PrintOrderDetailReport()
 {
     ShowReport(ReportInfoFactory.CustomerSalesDetailReport(QueriesHelper.GetCustomerSaleDetails(SelectedEntity.Id, CreateUnitOfWork().OrderItems)), "SalesDetail");
 }