Пример #1
0
        public Worksheet DoExport(RevisionAct act)
        {
            _worksheet = new Worksheet("Акт сверки");
            _worksheet.Cells.ColumnWidth[0] = (ushort)2.5 * 256;
            _worksheet.Cells.ColumnWidth[1] = (ushort)23 * 256;
            _worksheet.Cells.ColumnWidth[2] = (ushort)7 * 256;
            _worksheet.Cells.ColumnWidth[3] = (ushort)7 * 256;
            _worksheet.Cells.ColumnWidth[4] = (ushort)2.5 * 256;
            _worksheet.Cells.ColumnWidth[5] = (ushort)23 * 256;
            _worksheet.Cells.ColumnWidth[6] = (ushort)7 * 256;
            _worksheet.Cells.ColumnWidth[7] = (ushort)7 * 256;
            var h1 = new CellStyle {
                Font = new Font("Arial", 11)
                {
                    Bold = true
                },
                HorizontalAlignment = HorizontalAlignment.Center
            };
            var h2 = new CellStyle {
                Font = new Font("Arial", 10)
                {
                    Bold = true,
                },
                Warp = true,
            };

            var mark = new CellStyle {
                HorizontalAlignment = HorizontalAlignment.Center,
                Warp = true,
            };

            var longWord = new CellStyle {
                Warp = true
            };

            var underScrore = new CellStyle {
                Borders = new Borders {
                    Bottom = BorderStyle.Thin
                }
            };

            var table = new CellStyle {
                Font    = new Font("Arial", 8),
                Borders = Borders.Box(BorderStyle.Thin),
            };

            Row(h1, "Акт сверки", new Merge(8));
            var row = Row(mark,
                          String.Format("взаимных расчетов по состоянию на {0} между {1} и {2} по договору № {3}",
                                        act.EndDate.ToShortDateString(),
                                        act.Payer.Recipient.FullName,
                                        act.Payer.JuridicalName,
                                        act.Payer.Id),
                          new Merge(8));

            row.Height = 1440 / 72 * 43;
            row        = Row(longWord,
                             String.Format("Мы, нижеподписавшиеся, __________________ {0} _________________________,"
                                           + "с одной стороны, и ________________________ {1} __________________________, "
                                           + "с другой стороны составили настоящий акт сверки в том, что состояние взаимных расчетов по данным учета следующее:",
                                           act.Payer.Recipient.FullName,
                                           act.Payer.JuridicalName),
                             new Merge(8));
            row.Height = 1440 / 72 * 62;
            Row(table,
                String.Format("По данным {0}, руб.", act.Payer.Recipient.FullName), new Merge(4),
                String.Format("По данным {0}, руб.", act.Payer.JuridicalName), new Merge(4));
            Row(table,
                "№ п/п", "Наименование операции, документы", "Дебет", "Кредит",
                "№ п/п", "Наименование операции, документы", "Дебет", "Кредит");
            var index = 1;

            foreach (var move in act.Movements)
            {
                Row(table,
                    index, move.Name, move.Debit.ToString("#.#"), move.Credit.ToString("#.#"),
                    "", "", "", "");
                index++;
            }
            Skip();
            Row(String.Format("По данным {0}", act.Payer.Recipient.FullName), new Merge(4));
            row        = Row(h2, act.Result, new Merge(4));
            row.Height = 1440 / 72 * 29;
            Skip();
            Row(String.Format("От {0}", act.Payer.Recipient.FullName), new Merge(4),
                String.Format("От {0}", act.Payer.JuridicalName), new Merge(4));
            Skip(2);
            Row("", underScrore, "", underScrore, String.Format("({0})", act.Payer.Recipient.Boss), "",
                "", underScrore, "", underScrore, "", "");
            Skip();
            Row("М.П.", "", "", "",
                "М.П.", "", "", "");
            _worksheet.Cells[0, 0] = new Cell("Акт сверки")
            {
                Style = h1
            };
            return(_worksheet);
        }
Пример #2
0
 public static Worksheet Export(RevisionAct act)
 {
     return(new Exporter().DoExport(act));
 }