Exemplo n.º 1
0
        private static void old_CreateTableTitle(RtfTable table)
        {
            for (var j = 0; j < table.ColCount; j++)
            {
                for (var i = 0; i < 2; i++)
                {
                    table.Cell(i, j).DefaultCharFormat.FontStyle.AddStyle(FontStyleFlag.Bold);
                }
            }
            RTFWorkingProvider.AddTextToCell(0, 0, table, "№ п/п");
            RTFWorkingProvider.AddTextToCell(0, 1, table, "Идентификатор");
            RTFWorkingProvider.AddTextToCell(0, 2, table, "Тип велопарковки");
            RTFWorkingProvider.AddTextToCell(0, 3, table, "Вид велопарковки");
            RTFWorkingProvider.AddTextToCell(0, 4, table, "Статус");
            RTFWorkingProvider.AddTextToCell(0, 5, table, "Длина, м");
            RTFWorkingProvider.AddTextToCell(0, 6, table, "Ширина, м");
            RTFWorkingProvider.AddTextToCell(0, 7, table, "Количество секций");
            RTFWorkingProvider.AddTextToCell(0, 8, table, "Дата установки");
            RTFWorkingProvider.AddTextToCell(0, 9, table, "Дата обслуживания");


            for (var i = 0; i < table.ColCount; i++)
            {
                RTFWorkingProvider.AddTextToCell(1, i, table, (i + 1).ToString());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Отчет из плагина
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="someobjs"></param>
        public static void ReportMake(string fileName, IList <VeloObject> someobjs,
                                      float sectionFontSize = 8.5f, PaperOrientation paperOrientation = PaperOrientation.Portrait)
        {
            var doc = new RtfDocument(PaperSize.A4, paperOrientation, Lcid.Russian);

            RTFWorkingProvider.DocumentMargins(doc,
                                               paperOrientation == PaperOrientation.Landscape ? 2.5f : 1.5f,
                                               paperOrientation == PaperOrientation.Landscape ? 1.5f : 2.5f,
                                               1.5f, 1.5f);

            CreateDocumentTitle(doc);
            CreateDataTable(doc, someobjs, sectionFontSize);
            doc.Save(fileName);
        }
Exemplo n.º 3
0
        private static void old_FillDataTable(RtfTable table, IList <VeloObject> someobjs)
        {
            var i = 2;

            foreach (var so in someobjs)
            {
                RTFWorkingProvider.AddTextToCell(i, 0, table, (i - 1).ToString());
                RTFWorkingProvider.AddTextToCell(i, 1, table, so.ID.ToString());
                RTFWorkingProvider.AddTextToCell(i, 2, table, so.TypeAsString);
                RTFWorkingProvider.AddTextToCell(i, 3, table, so.ViewAsString);
                RTFWorkingProvider.AddTextToCell(i, 4, table, so.StatusAsString);
                RTFWorkingProvider.AddTextToCell(i, 5, table, so.VeloLength.ToString());
                RTFWorkingProvider.AddTextToCell(i, 6, table, so.VeloWidth.ToString());
                RTFWorkingProvider.AddTextToCell(i, 7, table, so.VeloSection.ToString());
                RTFWorkingProvider.AddTextToCell(i, 8, table, so.DataCheck?.ToShortDateString() ?? "");
                RTFWorkingProvider.AddTextToCell(i, 9, table, so.DataSet?.ToShortDateString() ?? "");

                i++;
            }
        }
Exemplo n.º 4
0
 private static void CreateDocumentTitle(RtfDocument document)
 {
     RTFWorkingProvider.AddTextToDocument(document, titleFontSize, HorizontalAlignment.Center, "Сводная ведомость");
     RTFWorkingProvider.AddEmptyLine(document, titleFontSize, HorizontalAlignment.Left);
     RTFWorkingProvider.AddEmptyLine(document, titleFontSize, HorizontalAlignment.Left);
 }