internal DataItemReportElementProperties(DataItemReportElement dataItemReportElement) { innerList.Add(dataItemTable); innerList.Add(dataItemTableView); innerList.Add(maxIteration); innerList.Add(printOnlyIfDetail); innerList.Add(reqFilterHeadingML); innerList.Add(onPreDataItem); innerList.Add(onAfterGetRecord); innerList.Add(onPostDataItem); innerList.Add(reqFilterFields); innerList.Add(calcFields); innerList.Add(dataItemLinkReference); innerList.Add(dataItemLink); #if NAV2015 innerList.Add(temporary); #endif }
public static IEnumerable<ParameterBase> ToParameters(this DataItemReportElement dataItemReportElement) { yield return new SimpleParameter("ID", dataItemReportElement.ID); if (!string.IsNullOrEmpty(dataItemReportElement.Name)) yield return new SimpleParameter("Name", dataItemReportElement.Name); yield return new ScriptBlockParameter( "SubObjects", dataItemReportElement.Properties.DataItemTableView.TableFilter.ToInvocations() .Concat(dataItemReportElement.Properties.DataItemLink.Select(l => l.ToInvocation())) .Concat(dataItemReportElement.Children.Select(e => e.ToInvocation())) ); foreach (var parameter in dataItemReportElement.AllProperties.Where(p => p.HasValue).SelectMany(p => p.ToParameters())) { yield return parameter; } }
protected override IEnumerable <ReportElement> CreateItems() { var element = new DataItemReportElement(DataItemTable, ID, IndentationLevel); element.Name = Name; element.Properties.CalcFields.AddRange(CalcFields); element.Properties.DataItemLinkReference = DataItemLinkReference; element.Properties.DataItemTableView.Key = DataItemTableViewKey; element.Properties.DataItemTableView.Order = DataItemTableViewOrder; element.Properties.MaxIteration = MaxIteration; element.Properties.OnPreDataItem.Set(OnPreDataItem); element.Properties.OnAfterGetRecord.Set(OnAfterGetRecord); element.Properties.OnPostDataItem.Set(OnPostDataItem); element.Properties.PrintOnlyIfDetail = NullableBooleanFromSwitch(nameof(PrintOnlyIfDetail)); element.Properties.ReqFilterFields.AddRange(ReqFilterFields); element.Properties.ReqFilterHeadingML.Set(ReqFilterHeadingML); #if NAV2015 element.Properties.Temporary = NullableBooleanFromSwitch(nameof(Temporary)); #endif yield return(element); var variables = new List <PSVariable>() { new PSVariable("ElementIndentation", element.IndentationLevel + 1) }; var subObjects = SubObjects?.InvokeWithContext(null, variables).Select(o => o.BaseObject) ?? Enumerable.Empty <object>(); element.Properties.DataItemLink.AddRange(subObjects.OfType <ReportDataItemLinkLine>()); element.Properties.DataItemTableView.TableFilter.AddRange(subObjects.OfType <TableFilterLine>()); foreach (var subObject in subObjects.OfType <ReportElement>()) { yield return(subObject); } }
public static Invocation ToInvocation(this DataItemReportElement dataItemReportElement) { return(new Invocation("New-CBreezeDataItemReportElement", dataItemReportElement.ToParameters())); }