Exemplo n.º 1
0
        private PdfPTable CustomerDetailTable()
        {
            PdfPTable table = FormatConfig.Table(7, new float[] { 0.5f, 1.5f, 2f, 2f, 1.2f, 1.3f, 1.5f });

            table.AddCell(FormatConfig.TableCellHeader("STT"));
            table.AddCell(FormatConfig.TableCellHeader("Ngày"));
            table.AddCell(FormatConfig.TableCellHeader("Mặt hàng"));
            table.AddCell(FormatConfig.TableCellHeader("Quy cách"));
            table.AddCell(FormatConfig.TableCellHeader("Số lượng"));
            table.AddCell(FormatConfig.TableCellHeader("ĐVT"));
            table.AddCell(FormatConfig.TableCellHeader("Tổng giá"));

            foreach (CustomerReport item in customerReports)
            {
                if (string.IsNullOrEmpty(item.Index))
                {
                    table.AddCell(FormatConfig.TableCellBoldBody(item.Date, PdfPCell.ALIGN_LEFT, 7));
                }
                else
                {
                    table.AddCell(FormatConfig.TableCellBody(item.Index, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.Date, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.ProductName, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.AttrName, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.Number, PdfPCell.ALIGN_RIGHT));
                    table.AddCell(FormatConfig.TableCellBody(item.Unit, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.Cost, PdfPCell.ALIGN_RIGHT));
                }
            }
            table.AddCell(FormatConfig.TableCellBoldBody("Tổng", PdfPCell.ALIGN_RIGHT, 6));
            table.AddCell(FormatConfig.TableCellBody(lbTotal.Text.Split(' ')[2], PdfPCell.ALIGN_RIGHT));
            return(table);
        }
        private PdfPTable ProductsTable()
        {
            PdfPTable table = FormatConfig.Table(9, new float[] { 0.5f, 1.3f, 2.5f, 0.7f, 1f, 1f, 1f, 1f, 1f });

            table.AddCell(FormatConfig.TableCellHeader("STT"));
            table.AddCell(FormatConfig.TableCellHeader("Mã SP"));
            table.AddCell(FormatConfig.TableCellHeader("Tên và qui cách"));
            table.AddCell(FormatConfig.TableCellHeader("Jampo"));
            table.AddCell(FormatConfig.TableCellHeader("ĐVT"));
            table.AddCell(FormatConfig.TableCellHeader("Đầu kì"));
            table.AddCell(FormatConfig.TableCellHeader("Nhập"));
            table.AddCell(FormatConfig.TableCellHeader("Xuất"));
            table.AddCell(FormatConfig.TableCellHeader("Cuối kì"));

            foreach (ProductsReport item in productsReports)
            {
                if (string.IsNullOrEmpty(item.Index))
                {
                    table.AddCell(FormatConfig.TableCellBoldBody(item.ProductName, PdfPCell.ALIGN_LEFT, 9));
                }
                else
                {
                    table.AddCell(FormatConfig.TableCellBody(item.Index, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.ProductCode, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.ProductName, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.Jampo, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.UnitName, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.FirstNumber, PdfPCell.ALIGN_RIGHT));
                    table.AddCell(FormatConfig.TableCellBody(item.ImportNumber, PdfPCell.ALIGN_RIGHT));
                    table.AddCell(FormatConfig.TableCellBody(item.ExportNumber, PdfPCell.ALIGN_RIGHT));
                    table.AddCell(FormatConfig.TableCellBody(item.LastNumber, PdfPCell.ALIGN_RIGHT));
                }
            }
            return(table);
        }
Exemplo n.º 3
0
        private PdfPTable CustomersTable()
        {
            PdfPTable table = FormatConfig.Table(6, new float[] { 0.5f, 1.5f, 2.5f, 2.5f, 2f, 1f });

            table.AddCell(FormatConfig.TableCellHeader("STT"));
            table.AddCell(FormatConfig.TableCellHeader("Ngày"));
            table.AddCell(FormatConfig.TableCellHeader("Tên khách hàng"));
            table.AddCell(FormatConfig.TableCellHeader("Mã khách hàng"));
            table.AddCell(FormatConfig.TableCellHeader("Mã phiếu"));
            table.AddCell(FormatConfig.TableCellHeader("Số tiền"));

            foreach (CustomersReport item in customersReports)
            {
                table.AddCell(FormatConfig.TableCellBody(item.Index.ToString(), PdfPCell.ALIGN_CENTER));
                table.AddCell(FormatConfig.TableCellBody(item.Date, PdfPCell.ALIGN_CENTER));
                table.AddCell(FormatConfig.TableCellBody(item.CustomerName, PdfPCell.ALIGN_CENTER));
                table.AddCell(FormatConfig.TableCellBody(item.CustomerCode, PdfPCell.ALIGN_CENTER));
                table.AddCell(FormatConfig.TableCellBody(item.RecordCode, PdfPCell.ALIGN_CENTER));
                table.AddCell(FormatConfig.TableCellBody(item.Amount, PdfPCell.ALIGN_RIGHT));
            }
            table.AddCell(FormatConfig.TableCellBoldBody("Tổng", PdfPCell.ALIGN_RIGHT, 5));
            table.AddCell(FormatConfig.TableCellBody(lbTotal.Text.Split(' ')[2], PdfPCell.ALIGN_RIGHT));
            return(table);
        }
Exemplo n.º 4
0
        private PdfPTable EmployeeDetailTable()
        {
            PdfPTable table = FormatConfig.Table(9, new float[] { 0.5f, 1.3f, 1.5f, 1.3f, 1.4f, 1f, 1f, 1f, 1f });

            table.AddCell(FormatConfig.TableCellHeader("STT"));
            table.AddCell(FormatConfig.TableCellHeader("Ngày"));
            table.AddCell(FormatConfig.TableCellHeader("Tên khách hàng"));
            table.AddCell(FormatConfig.TableCellHeader("Mặt hàng"));
            table.AddCell(FormatConfig.TableCellHeader("Quy cách"));
            table.AddCell(FormatConfig.TableCellHeader("Số lượng"));
            table.AddCell(FormatConfig.TableCellHeader("ĐVT"));
            table.AddCell(FormatConfig.TableCellHeader("Đơn giá"));
            table.AddCell(FormatConfig.TableCellHeader("Hoa hồng"));

            foreach (EmployeeReport item in employee_reports)
            {
                if (string.IsNullOrEmpty(item.Index))
                {
                    table.AddCell(FormatConfig.TableCellBoldBody(item.CustomerName, PdfPCell.ALIGN_LEFT, 9));
                }
                else
                {
                    table.AddCell(FormatConfig.TableCellBody(item.Index, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.Date, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.CustomerName, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.ProductName, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.AttrName, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.Number, PdfPCell.ALIGN_RIGHT));
                    table.AddCell(FormatConfig.TableCellBody(item.Unit, PdfPCell.ALIGN_CENTER));
                    table.AddCell(FormatConfig.TableCellBody(item.Price, PdfPCell.ALIGN_RIGHT));
                    table.AddCell(FormatConfig.TableCellBody(item.Commission, PdfPCell.ALIGN_RIGHT));
                }
            }

            return(table);
        }