As you can see here, on 2018.2.2 after opening a report with Designer.WinForms.exe (or with our .NET implementation) and looking at the data sources, there are automatically generated relations between a node (e.g. FactuurView --> PakbonnenView --> FactuurRegelsView) and its children (e.g. FactuurView --> PakbonnenView --> FactuurRegelsView --> VerkooporderRegel & PakbonnenView). As another example, the relation "FactuurView_PakbonnenView_FactuurRegelsView_VerkoopOrder.Artikel" points to "FactuurView_PakbonnenView_FactuurRegelsView_VerkoopOrder_Artikel".
However on 2024.1.3, which is performing well in the Designer.exe, something goes wrong in our .NET implementation.
Code: Select all
public static DataSetResultInfo CreateAndFillDataSet(IProcessInstance processInstance, DataSetInfo requestedData)
{
var usedPaths = GetUsedDataRows(requestedData);
var columnMappingCurrentDataSet = new Dictionary<IExpression, TableColumnInfo>();
var rootInstance = processInstance[requestedData.Root];
var tmpPrimaryKeys = new Dictionary<object, int>();
var entityCollectionRoot = requestedData.Root as IManagedDynamicCollection;
if (entityCollectionRoot != null)
{
var tableInfos = CreateAndFillDataSetForCollectionRoot(requestedData, usedPaths, entityCollectionRoot, processInstance, columnMappingCurrentDataSet, tmpPrimaryKeys);
return new DataSetResultInfo(columnMappingCurrentDataSet, tableInfos);
}
var entityRoot = requestedData.Root as IEntity;
if (entityRoot != null)
{
var tableInfos = CreateAndFillDataSetForEntityRoot(requestedData, usedPaths, entityRoot, (IEntityInstance)rootInstance, columnMappingCurrentDataSet, tmpPrimaryKeys);
return new DataSetResultInfo(columnMappingCurrentDataSet, tableInfos);
}
var summaryRoot = requestedData.Root as ISummary;
if (summaryRoot != null)
{
var tableInfos = CreateAndFillDataSetForSummaryRoot(requestedData, usedPaths, summaryRoot, (ISummaryInstance)rootInstance, columnMappingCurrentDataSet, tmpPrimaryKeys);
return new DataSetResultInfo(columnMappingCurrentDataSet, tableInfos);
}
throw new NotImplementedException();
}
Code: Select all
var dataSets = definition.DataSets
.Select(reportDataSet => DataSetBuilder.CreateAndFillDataSet(processInstance, new DataSetInfo(reportDataSet.Root, reportDataSet.Fields, definition.CustomTableNames, translator)))
.ToDictionary(map => map.DataTablesMetaInfo.First().Table.DataSet);
dataSets.Keys.ForEach(report.RegData);
... validation ...
foreach (var dataSetColumnMappingsPair in dataSets)
{
foreach (var expressionColumnInfoPair in dataSetColumnMappingsPair.Value.ColumnMappingMetaInfo)
{
IExpression<IText> description = null;
if (expressionColumnInfoPair.Key is IReadOnlyProperty) // expression is almost always a property (with a description),
description = ((IReadOnlyProperty)expressionColumnInfoPair.Key).Description;
else if (expressionColumnInfoPair.Key is IEvaluableMethodCall) // but can also be a method call
description = ((IEvaluableMethodCall)expressionColumnInfoPair.Key).WorkDescription;
if (description == null)
description = expressionColumnInfoPair.Value.Column.ColumnName.AsText(); // just incase (methods for example do not require a description)
RegisterVariable(report,
dataSetColumnMappingsPair.Key.DataSetName + ".Headers",
expressionColumnInfoPair.Value.TableInfo.Table.TableName + "." + expressionColumnInfoPair.Value.Column.ColumnName,
description,
uniqueVariableNames,
isCompiledReport,
validateData, translator, processInstance);
}
}
... register other variables ...
report.Dictionary.RegRelations();
report.Dictionary.Synchronize();