예제 #1
0
        //一参构造
        public Q20(IList <Model.Customer> customerDetails)
            : this()
        {
            this.customerDetails = customerDetails;

            IList <Model.InvoiceXS> xsdetails = new List <Model.InvoiceXS>();
            IList <Model.InvoiceXS> xsdetail  = new List <Model.InvoiceXS>();

            foreach (Model.Customer customer in this.customerDetails)
            {
                xsdetail = invoiceManager.Select(customer);
                if (xsdetail != null)
                {
                    foreach (Model.InvoiceXS xsInvoice in xsdetail)
                    {
                        xsdetails.Add(xsInvoice);
                    }
                    xsdetail.Clear();
                }
            }

            if (xsdetails == null || xsdetails.Count <= 0)
            {
                throw new global::Helper.InvalidValueException("無數據");
            }

            this.bindingSource1.DataSource = xsdetails;
            this.xrLabelReportName.Text    = Properties.Resources.CHDetail;
            //  this.xrLabelDateRange.Text = string.Format(Properties.Resources.DateRange, start.ToString("yyyy/MM/dd"), end.ToString("yyyy/MM/dd"));
            //this.xrTableCellInvoiceId.DataBindings.Add("Text", this.DataSource, Model.Invoice.PROPERTY_INVOICEID);
            //this.xrTableCellInvoiceDate.DataBindings.Add("Text", this.DataSource, Model.Invoice.PROPERTY_INVOICEDATE, "{0:yyyy-MM-dd}");



            this.xrLabelTotalHeJi.Summary.FormatString     = "{0:0}";
            this.xrLabelTotalHeJi.Summary.Func             = SummaryFunc.Sum;
            this.xrLabelTotalHeJi.Summary.IgnoreNullValues = true;
            this.xrLabelTotalHeJi.Summary.Running          = SummaryRunning.Report;
            this.xrLabelTotalHeJi.DataBindings.Add("Text", this.DataSource, "invoiceXO.InvoiceHeji", "{0:0}");

            this.xrLabelTotalTax.Summary.FormatString     = "{0:0}";
            this.xrLabelTotalTax.Summary.Func             = SummaryFunc.Sum;
            this.xrLabelTotalTax.Summary.IgnoreNullValues = true;
            this.xrLabelTotalTax.Summary.Running          = SummaryRunning.Report;


            this.xrLabelTotalTax.DataBindings.Add("Text", this.DataSource, "InvoiceXO.InvoiceTax", "{0:0}");
            //this.xrTableCellCustomName.DataBindings.Add("Text", this.DataSource, "CustomerName");


            this.xrLabelTotalZongJi.Summary.FormatString     = "{0:0}";
            this.xrLabelTotalZongJi.Summary.Func             = SummaryFunc.Sum;
            this.xrLabelTotalZongJi.Summary.IgnoreNullValues = true;
            this.xrLabelTotalZongJi.Summary.Running          = SummaryRunning.Report;
            this.xrLabelTotalZongJi.DataBindings.Add("Text", this.DataSource, "InvoiceXO.InvoiceTotal", "{0:0}");

            //this.xrLabelTotalZSE.Summary.FormatString = "{0:0}";
            //this.xrLabelTotalZSE.Summary.Func = SummaryFunc.Sum;
            //this.xrLabelTotalZSE.Summary.IgnoreNullValues = true;
            //this.xrLabelTotalZSE.Summary.Running = SummaryRunning.Report;
            //this.xrLabelTotalZSE.DataBindings.Add("Text", this.DataSource, Model.InvoiceXS.PROPERTY_INVOICEZSE, "{0:0}");


            this.xrSubreport1.ReportSource = new Q20_1();
        }
예제 #2
0
 private void XSDetailForm_Load(object sender, EventArgs e)
 {
     this.bindingSourceXSID.DataSource     = xsManager.Select(invoicexo);
     this.bindingSourceXODetail.DataSource = xoDetailManager.Select(this.invoicexo, false);
 }