Пример #1
0
            public void Write(XslFOProfileWriter foWriter, IEnumerable <BaseData> values)
            {
                foWriter.TStart(true, "TABLE", false);
                foWriter.TAddColumn("№", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "5%", align.ALIGN_NONE, valign.VALIGN_NONE, "TABLE_HEADER");
                foWriter.TAddColumn("Департамент", align.ALIGN_LEFT, valign.VALIGN_MIDDLE, null, "75%", align.ALIGN_NONE, valign.VALIGN_NONE, "TABLE_HEADER");
                foWriter.TAddColumn("Трудозатраты", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "20%", align.ALIGN_NONE, valign.VALIGN_NONE, "TABLE_HEADER");

                Dictionary <Type, string> rowClasses = new Dictionary <Type, string>();

                rowClasses.Add(typeof(DepartmentData), "GROUP_HEADER");
                rowClasses.Add(typeof(DepartmentDetailData), "TABLE_CELL");
                rowClasses.Add(typeof(OverallData), "TABLE_FOOTER");

                foreach (BaseData value in values)
                {
                    foWriter.TRStart();
                    if (value is OverallData)
                    {
                        foWriter.TRAddCell("Итого", null, 1, 1, rowClasses[value.GetType()]);
                    }
                    else
                    {
                        foWriter.TRAddCell(indexGenerator.Generate(), null, 1, 1, rowClasses[value.GetType()]);
                    }
                    foWriter.TRAddCell(CustomReport.xmlEncode(value.Name), null, 1, 1, rowClasses[value.GetType()]);
                    foWriter.TRAddCell(costsFormatter.Format(value.Costs), null, 1, 1, rowClasses[value.GetType()]);
                    foWriter.TREnd();
                }

                foWriter.TEnd();
            }
Пример #2
0
 //Переопределяем базовый метод, чтобы убрать в пустых ячейках надпись "(нет данных)"
 private string xmlEncode(object s = null)
 {
     return(CustomReport.xmlEncode(s == null?"  ":s));
 }