Пример #1
0
        private static void WriteBody(SLDocument sl, U2Report u2Report)
        {
            var rowStart = u2Report.Headers.Count + 2;

            for (var rowIndex = 1; rowIndex < u2Report.Body.Count; rowIndex++)
            {
                var rowContent = ReportReader.GetBodyCells(u2Report.Body[rowIndex]);



                for (var columnIndex = 1; columnIndex < rowContent.Count; columnIndex++)
                {
                    var content = rowContent[columnIndex - 1];


                    var rowPosition = rowStart + rowIndex;

                    if (u2Report.IsMoneyColumn(columnIndex))
                    {
                        PrintMoneyCell(sl, rowPosition, columnIndex, content);
                    }
                    else
                    {
                        sl.SetCellValue(rowPosition, columnIndex, content);
                        if (rowIndex % 2 == 0)
                        {
                            sl.SetCellStyle(rowPosition, columnIndex, U2ReportStyles.GetStripStyle(sl));
                        }
                    }
                }
            }
        }
Пример #2
0
        private static void SetupColumnsFilter(SLDocument sl, U2Report u2Report)
        {
            var rowStart      = u2Report.Headers.Count + 2;
            var cellsContent  = ReportReader.GetBodyCells(u2Report.Body[0]);
            var columnCounter = 1;


            foreach (var line in cellsContent)
            {
                sl.SetCellValue(rowStart, columnCounter, line);
                sl.SetCellStyle(rowStart, columnCounter, U2ReportStyles.GetColumnsFilterStyle(sl));
                sl.SetColumnWidth(columnCounter, U2ReportStyles.ColumnWidth);

                columnCounter++;
            }

            var cellRef    = $"A{rowStart}";
            var cellRefEnd = $"XX{rowStart}";

            sl.Filter(cellRef, cellRefEnd);
        }