예제 #1
0
파일: TableFor.cs 프로젝트: nico-izo/KOIB
 public override Table[] GetTables(ReportTemplateParser parser)
 {
     var resultTables = new List<Table>();
     try
     {
         if (Body != null)
         {
             parser.RunFor(Each, In,
                           delegate
                           {
                               foreach (Table tableTemplate in Body)
                               {
                                   var table = new Table
                                                   {
                                                       Columns = tableTemplate.Columns,
                                                       IsDotted = tableTemplate.IsDotted,
                                                       Lines = new Lines()
                                                   };
                                 table.Lines.AddRange(ReportTemplate.ConstructHeader(tableTemplate.Body));
                                   resultTables.Add(table);
                               }
                           });
         }
     }
     catch (ReportTemplateParserException pex)
     {
         throw new ApplicationException("Ошибка построения тела таблицы", pex);
     }
     return resultTables.ToArray();
 }
예제 #2
0
파일: TableFor.cs 프로젝트: xoposhiy/KOIB
        public override Table[] GetTables(ReportTemplateParser parser)
        {
            var resultTables = new List <Table>();

            try
            {
                if (Body != null)
                {
                    parser.RunFor(Each, In,
                                  delegate
                    {
                        foreach (Table tableTemplate in Body)
                        {
                            var table = new Table
                            {
                                Columns  = tableTemplate.Columns,
                                IsDotted = tableTemplate.IsDotted,
                                Lines    = new Lines()
                            };
                            table.Lines.AddRange(ReportTemplate.ConstructHeader(tableTemplate.Body));
                            resultTables.Add(table);
                        }
                    });
                }
            }
            catch (ReportTemplateParserException pex)
            {
                throw new ApplicationException("Ошибка построения тела таблицы", pex);
            }
            return(resultTables.ToArray());
        }
예제 #3
0
        public override Lines ConstructContent(ReportTemplateParser parser)
        {
            var lines = new Lines();

            try
            {
                if (Body != null)
                {
                    parser.RunFor(Each, In,
                                  delegate
                    {
                        foreach (BasePlainElement element in Body)
                        {
                            lines.AddRange(element.ConstructContent(parser));
                        }
                    });
                }
            }
            catch (ReportTemplateParserException pex)
            {
                lines.Add(new ReportLine(
                              new[] { "-+- FOR: " + pex.Reason + " (" + pex.Type + "." + pex.Name + ") -!-" },
                              LineAlign.Left, "0", false, false, false, false, -1));
            }
            return(lines);
        }
예제 #4
0
파일: ForClause.cs 프로젝트: nico-izo/KOIB
 public override Lines ConstructContent(ReportTemplateParser parser)
 {
     var lines = new Lines();
     try
     {
         if (Body != null)
         {
             parser.RunFor(Each, In,
                           delegate
                               {
                                   foreach (BasePlainElement element in Body)
                                   {
                                       lines.AddRange(element.ConstructContent(parser));
                                   }
                               });
         }
     }
     catch (ReportTemplateParserException pex)
     {
         lines.Add(new ReportLine(
             new[] {"-+- FOR: " + pex.Reason + " (" + pex.Type + "." + pex.Name + ") -!-" },
             LineAlign.Left, "0", false, false, false, false, -1));
     }
     return lines;
 }
예제 #5
0
        public override Lines ConstructContent(ReportTemplateParser parser)
        {
            var lines = new Lines();

            if (parser.Check(Condition, Not))
            {
                if (Columns == null || Columns.Length <= 0)
                {
                    var text = new[]
                    {
                        parser.Format(LinePart.ConstructLine(parser, Part, Text ?? String.Empty))
                    };
                    if (!string.IsNullOrEmpty(SplitChar))
                    {
                        text = text[0].Split(SplitChar.ToCharArray());
                    }
                    foreach (string s in text)
                    {
                        lines.Add(
                            new ReportLine(new[] { NeedTrim?s.Trim() : s },
                                           Align ?? LineAlign.Left,
                                           FontSize, IsBold, IsItalic, false, false, IsLineDotted));
                    }
                }
                else
                {
                    var columns = new ArrayList();
                    foreach (LinePart t in Columns)
                    {
                        if (parser.Check(t.Condition, t.Not))
                        {
                            if (t.In != null && t.Each != null)
                            {
                                parser.RunFor(t.Each, t.In,
                                              () => columns.Add(parser.Format(
                                                                    LinePart.ConstructLine
                                                                        (parser, t.Part, t.Text ?? String.Empty))));
                            }
                            else
                            {
                                columns.Add(parser.Format(
                                                LinePart.ConstructLine(parser, t.Part, t.Text ?? String.Empty)));
                            }
                        }
                    }
                    var arr = new string[columns.Count];
                    columns.CopyTo(arr);
                    lines.Add(new ReportLine(arr,
                                             Align ?? LineAlign.Left,
                                             FontSize, IsBold, IsItalic, NewPage, ResetPageNumber, IsLineDotted));
                }
            }
            return(lines);
        }
예제 #6
0
파일: LineClause.cs 프로젝트: nico-izo/KOIB
 public override Lines ConstructContent(ReportTemplateParser parser)
 {
     var lines = new Lines();
     if (parser.Check(Condition, Not))
     {
         if (Columns == null || Columns.Length <= 0)
         {
             var text = new[]
             {
                 parser.Format(LinePart.ConstructLine(parser, Part, Text ?? String.Empty))
             };
             if (!string.IsNullOrEmpty(SplitChar))
             {
                 text = text[0].Split(SplitChar.ToCharArray());
             }
             foreach (string s in text)
             {
                 lines.Add(
                     new ReportLine(new[] {NeedTrim ? s.Trim() : s},
                                    Align ?? LineAlign.Left,
                                    FontSize, IsBold, IsItalic, false, false, IsLineDotted));
             }
         }
         else
         {
             var columns = new ArrayList();
             foreach (LinePart t in Columns)
             {
                 if (parser.Check(t.Condition, t.Not))
                 {
                     if (t.In != null && t.Each != null)
                     {
                         parser.RunFor(t.Each, t.In,
                                       () => columns.Add(parser.Format(
                                           LinePart.ConstructLine
                                               (parser, t.Part, t.Text ?? String.Empty))));
                     }
                     else
                     {
                         columns.Add(parser.Format(
                             LinePart.ConstructLine(parser, t.Part, t.Text ?? String.Empty)));
                     }
                 }
             }
             var arr = new string[columns.Count];
             columns.CopyTo(arr);
             lines.Add(new ReportLine(arr,
                                      Align ?? LineAlign.Left,
                                      FontSize, IsBold, IsItalic, NewPage, ResetPageNumber, IsLineDotted));
         }
     }
     return lines;
 }
예제 #7
0
 public override Lines ConstructContent(ReportTemplateParser parser)
 {
     Lines lines = new Lines();
     int rowNumber = 0;
     if (!Int32.TryParse(Value, out rowNumber))
     {
         if (!Int32.TryParse(parser.Format(Value), out rowNumber))
         {
             rowNumber = 0;
         }
     }
     lines.Add(new ServiceLine(rowNumber));
     return lines;
 }
예제 #8
0
파일: LinePart.cs 프로젝트: nico-izo/KOIB
 public static string ConstructLine(ReportTemplateParser parser, LinePart[] parts, string defaultText)
 {
     if (parts != null && parts.Length > 0)
     {
         defaultText = "";
         foreach (LinePart part in parts)
         {
             if (parser.Check(part.Condition, part.Not))
             {
                 defaultText += part.GetLine(parser);
             }
         }
     }
     return defaultText;
 }
예제 #9
0
        public override Lines ConstructContent(ReportTemplateParser parser)
        {
            Lines lines     = new Lines();
            int   rowNumber = 0;

            if (!Int32.TryParse(Value, out rowNumber))
            {
                if (!Int32.TryParse(parser.Format(Value), out rowNumber))
                {
                    rowNumber = 0;
                }
            }
            lines.Add(new ServiceLine(rowNumber));
            return(lines);
        }
예제 #10
0
 public static string ConstructLine(ReportTemplateParser parser, LinePart[] parts, string defaultText)
 {
     if (parts != null && parts.Length > 0)
     {
         defaultText = "";
         foreach (LinePart part in parts)
         {
             if (parser.Check(part.Condition, part.Not))
             {
                 defaultText += part.GetLine(parser);
             }
         }
     }
     return(defaultText);
 }
예제 #11
0
파일: IfClause.cs 프로젝트: nico-izo/KOIB
 public override Lines ConstructContent(ReportTemplateParser parser)
 {
     var lines = new Lines();
     try
     {
         BasePlainElement[] branch = parser.Check(Condition, Not) ? Then : Else;
         if (branch != null)
         {
             foreach (BasePlainElement element in branch)
             {
                 lines.AddRange(element.ConstructContent(parser));
             }
         }
     }
     catch (ReportTemplateParserException pex)
     {
         lines.Add(new ReportLine(
             new[]{"-+- IF: " + pex.Reason + " (" + pex.Type + "." + pex.Name + ") -!-"},
             LineAlign.Left, "0", false, false, false, false, -1));
     }
     return lines;
 }
예제 #12
0
파일: IfClause.cs 프로젝트: xoposhiy/KOIB
        public override Lines ConstructContent(ReportTemplateParser parser)
        {
            var lines = new Lines();

            try
            {
                BasePlainElement[] branch = parser.Check(Condition, Not) ? Then : Else;
                if (branch != null)
                {
                    foreach (BasePlainElement element in branch)
                    {
                        lines.AddRange(element.ConstructContent(parser));
                    }
                }
            }
            catch (ReportTemplateParserException pex)
            {
                lines.Add(new ReportLine(
                              new[] { "-+- IF: " + pex.Reason + " (" + pex.Type + "." + pex.Name + ") -!-" },
                              LineAlign.Left, "0", false, false, false, false, -1));
            }
            return(lines);
        }
예제 #13
0
 public string GetLine(ReportTemplateParser parser)
 {
     return(ConstructLine(parser, Part, Text ?? String.Empty));
 }
예제 #14
0
 public override Lines ConstructContent(ReportTemplateParser parser)
 {
     return new Lines();
 }
예제 #15
0
파일: LinePart.cs 프로젝트: nico-izo/KOIB
 public string GetLine(ReportTemplateParser parser)
 {
     return ConstructLine(parser, Part, Text ?? String.Empty);
 }
예제 #16
0
파일: Table.cs 프로젝트: nico-izo/KOIB
 public override Table[] GetTables(ReportTemplateParser parser)
 {
     Lines = new Lines();
     Lines.AddRange(ReportTemplate.ConstructHeader(Body));
     return new[] {this};
 }
예제 #17
0
 public override Lines ConstructContent(ReportTemplateParser parser)
 {
     return(new Lines());
 }
예제 #18
0
 public override Table[] GetTables(ReportTemplateParser parser)
 {
     Lines = new Lines();
     Lines.AddRange(ReportTemplate.ConstructHeader(Body));
     return(new[] { this });
 }