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(); }
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()); }
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); }
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; }
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); }
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; }
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; }
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; }
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); }
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); }
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; }
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); }
public string GetLine(ReportTemplateParser parser) { return(ConstructLine(parser, Part, Text ?? String.Empty)); }
public override Lines ConstructContent(ReportTemplateParser parser) { return new Lines(); }
public string GetLine(ReportTemplateParser parser) { return ConstructLine(parser, Part, Text ?? String.Empty); }
public override Table[] GetTables(ReportTemplateParser parser) { Lines = new Lines(); Lines.AddRange(ReportTemplate.ConstructHeader(Body)); return new[] {this}; }
public override Lines ConstructContent(ReportTemplateParser parser) { return(new Lines()); }
public override Table[] GetTables(ReportTemplateParser parser) { Lines = new Lines(); Lines.AddRange(ReportTemplate.ConstructHeader(Body)); return(new[] { this }); }