コード例 #1
0
        private void PrintInternalGroup(string groupTitle)
        {
            // Header row
            HeaderCells.Clear();
            HeaderCells.Add(GetCell("CSR #", DataFontBold, Element.ALIGN_LEFT));
            HeaderCells.Add(GetCell("Description", DataFontBold, Element.ALIGN_LEFT));
            HeaderCells.Add(GetCell("Amount", DataFontBold, Element.ALIGN_RIGHT));
            if (!_PrintDrawerTotals)
            {
                HeaderCells.Add(GetCell("Comment", DataFontBold, Element.ALIGN_LEFT));
            }
            HeaderCells.Add(GetCell("Time", DataFontBold, Element.ALIGN_LEFT));

            PdfPTable dataTable = new PdfPTable(HeaderCells.Count);

            AddGroupTitle(dataTable, groupTitle);

            AddHeaderCells(dataTable);
            dataTable.HeaderRows = 2;

            PrintGroupDetail(dataTable);

            CashTransferGroupTotals totals = _PrintDrawerTotals ? _DrawerTotals : _SafeTotals;

            dataTable.AddCell(GetCell("Total", DataFont, Element.ALIGN_JUSTIFIED, 1, Rectangle.TOP_BORDER));
            dataTable.AddCell(GetCell(totals.Count.ToString(), DataFont, Element.ALIGN_LEFT, 1, Rectangle.TOP_BORDER));
            dataTable.AddCell(GetCell(GetCurrencyValue(totals.Total), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
            dataTable.AddCell(GetCell(string.Empty, DataFont, Element.ALIGN_JUSTIFIED, HeaderCells.Count - 3, Rectangle.TOP_BORDER));

            AddGroupContentsToPdfTable(dataTable);
        }
コード例 #2
0
        private void PrintInternalGroup(string groupTitle)
        {
            // Header row
            HeaderCells.Clear();
            HeaderCells.Add(GetCell("CSR #", DataFontBold, Element.ALIGN_JUSTIFIED));
            if (_PrintingReceived)
            {
                HeaderCells.Add(GetCell("Amount Recieved", DataFontBold, Element.ALIGN_RIGHT));
            }
            else
            {
                HeaderCells.Add(GetCell("Amount Sent", DataFontBold, Element.ALIGN_RIGHT));
            }
            HeaderCells.Add(GetCell("Time", DataFontBold, Element.ALIGN_LEFT));
            if (!_PrintingReceived)
            {
                HeaderCells.Add(GetCell("Fee", DataFontBold, Element.ALIGN_RIGHT));
            }
            HeaderCells.Add(GetCell("Customer Name", DataFontBold, Element.ALIGN_LEFT));
            if (!_PrintingReceived)
            {
                HeaderCells.Add(GetCell("Send Type", DataFontBold, Element.ALIGN_LEFT));
            }
            HeaderCells.Add(GetCell("MTCN", DataFontBold, Element.ALIGN_LEFT));

            PdfPTable dataTable = new PdfPTable(HeaderCells.Count);

            AddGroupTitle(dataTable, groupTitle);

            AddHeaderCells(dataTable);
            dataTable.HeaderRows = 2;

            PrintGroupDetail(dataTable);

            WireTransferGroupTotals totals = _PrintingReceived ? _ReceivedTotals : _SentTotals;

            dataTable.AddCell(GetCell("Total", DataFont, Element.ALIGN_JUSTIFIED, 1, Rectangle.TOP_BORDER));
            dataTable.AddCell(GetCell(GetCurrencyValue(totals.Total), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
            dataTable.AddCell(GetCell(string.Empty, DataFont, Element.ALIGN_JUSTIFIED, 1, Rectangle.TOP_BORDER));
            if (!_PrintingReceived)
            {
                dataTable.AddCell(GetCell(GetCurrencyValue(totals.TotalFees), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
            }
            dataTable.AddCell(GetCell(totals.Count.ToString(), DataFont, Element.ALIGN_LEFT, _PrintingReceived ? 2 : 3, Rectangle.TOP_BORDER));

            dataTable.AddCell(GetCell(string.Empty, DataFont, Element.ALIGN_JUSTIFIED, 2, Rectangle.TOP_BORDER));

            AddGroupContentsToPdfTable(dataTable);
        }
コード例 #3
0
        protected override void OnBuildSection()
        {
            try
            {
                if (GroupData.Rows.Count < 1)
                {
                    return;
                }

                count      = 0;
                total      = 0;
                total_tax  = 0;
                total_fees = 0;
                grandTotal = 0;


                // Header row
                HeaderCells.Clear();
                HeaderCells.Add(GetCell("CSR #", DataFontBold, Element.ALIGN_LEFT));
                if (!isLayaway)
                {
                    HeaderCells.Add(GetCell("MSR #", DataFontBold, Element.ALIGN_LEFT));
                }
                if (!isLayaway && _title.Equals("Retail Sale Refunds"))
                {
                    HeaderCells.Add(GetCell("Refund #", DataFontBold, Element.ALIGN_LEFT));
                }
                else
                {
                    HeaderCells.Add(GetCell("Layaway #", DataFontBold, Element.ALIGN_LEFT));
                }
                HeaderCells.Add(GetCell("\nItem Description", DataFontBold, Element.ALIGN_LEFT));
                HeaderCells.Add(GetCell("Tender Type", DataFontBold, Element.ALIGN_LEFT));
                HeaderCells.Add(GetCell("Customer \nor Vendor Name", DataFontBold, Element.ALIGN_LEFT));
                HeaderCells.Add(GetCell("Time", DataFontBold, Element.ALIGN_LEFT));
                if (!isLayaway)
                {
                    HeaderCells.Add(GetCell("\nItem\nCost", DataFontBold, Element.ALIGN_RIGHT));
                    HeaderCells.Add(GetCell("Sale Amount", DataFontBold, Element.ALIGN_RIGHT));
                    HeaderCells.Add(GetCell("Sales Tax", DataFontBold, Element.ALIGN_RIGHT));
                    HeaderCells.Add(GetCell("Other Fees", DataFontBold, Element.ALIGN_RIGHT));
                    if (_title.Equals("Retail Sale Refunds"))
                    {
                        HeaderCells.Add(GetCell("Refund\nAmount", DataFontBold, Element.ALIGN_RIGHT));
                    }
                    else
                    {
                        HeaderCells.Add(GetCell("Retail\nAmount", DataFontBold, Element.ALIGN_RIGHT));
                    }
                }
                else
                {
                    HeaderCells.Add(GetCell("", DataFontBold, Element.ALIGN_RIGHT));
                    HeaderCells.Add(GetCell("Service Fee", DataFontBold, Element.ALIGN_RIGHT));
                    HeaderCells.Add(GetCell("Layaway Amount", DataFontBold, Element.ALIGN_RIGHT));
                }

                PdfPTable dataTable = new PdfPTable(HeaderCells.Count);

                if (dataTable.NumberOfColumns == 12)
                {
                    dataTable.SetWidths(new[] { 6f, 7f, 9f, 27f, 20f, 23f, 7f, 7f, 7f, 7f, 7f, 7f });
                }
                else
                {
                    dataTable.SetWidths(new[] { 6f, 9f, 27f, 20f, 23f, 7f, 7f, 7f, 7f });
                }

                AddGroupTitle(dataTable, _title);
                AddHeaderCells(dataTable);

                dataTable.HeaderRows = 2;

                PrintGroupDetail(dataTable);


                dataTable.AddCell(GetCell("Total", DataFont, Element.ALIGN_JUSTIFIED, 1, Rectangle.TOP_BORDER));
                dataTable.AddCell(GetCell(count.ToString(), DataFont, Element.ALIGN_LEFT, 1, Rectangle.TOP_BORDER));

                if (dataTable.NumberOfColumns == 12)
                {
                    dataTable.AddCell(GetCell("", DataFont, Element.ALIGN_RIGHT, 5, Rectangle.TOP_BORDER));
                    dataTable.AddCell(GetCell(GetCurrencyValue(total_cost), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
                    dataTable.AddCell(GetCell(GetCurrencyValue(total), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
                    dataTable.AddCell(GetCell(GetCurrencyValue(total_tax), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
                    dataTable.AddCell(GetCell(GetCurrencyValue(total_fees), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
                    dataTable.AddCell(GetCell(GetCurrencyValue(grandTotal), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
                }
                else
                {
                    dataTable.AddCell(GetCell("", DataFont, Element.ALIGN_RIGHT, 5, Rectangle.TOP_BORDER));
                    dataTable.AddCell(GetCell(GetCurrencyValue(total_fees), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
                    dataTable.AddCell(GetCell(GetCurrencyValue(total), DataFont, Element.ALIGN_RIGHT, 1, Rectangle.TOP_BORDER));
                }

                AddGroupContentsToPdfTable(dataTable);
            }
            catch (Exception ex)
            {
                ErrorText = ex.Message;
                ErrorCode = "1";
                throw;
            }
        }