Hello.
I’m using LINQ Reporting Engine from Aspose.Words for .NET version 23.5.0
.
I have a problem when creating a JsonDataSource
based on such a sample json:
{
"P1": {
"values": [
"XYZ"
],
"rowNumber": 0
},
"P2": {
"values": [
"ABC"
],
"rowNumber": 0
},
"P3": {
"values": {
"P3_N1": {
"level": 0,
"fieldName": "P3_N1"
}
}
}
}
The source is created as follows:
new JsonDataSource(collectionStream);
As a result, it receives such an error:
System.ArgumentException
Cannot add constraint to DataTable 'values' which is a child table in two nested relations.
at System.Data.ConstraintCollection.Add(Constraint constraint, Boolean addUniqueWhenAddingForeign)
at System.Data.DataColumn.SetOrdinalInternal(Int32 ordinal)
at System.Data.DataTable.AddUniqueKey(Int32 position)
at System.Data.XSDSchema.InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, Boolean isRef)
at System.Data.XSDSchema.HandleTable(XmlSchemaElement node)
at System.Data.XSDSchema.HandleParticle(XmlSchemaParticle pt, DataTable table, ArrayList tableChildren, Boolean isBase)
at System.Data.XSDSchema.HandleComplexType(XmlSchemaComplexType ct, DataTable table, ArrayList tableChildren, Boolean isNillable)
at System.Data.XSDSchema.InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, Boolean isRef)
at System.Data.XSDSchema.HandleTable(XmlSchemaElement node)
at System.Data.XSDSchema.HandleParticle(XmlSchemaParticle pt, DataTable table, ArrayList tableChildren, Boolean isBase)
at System.Data.XSDSchema.HandleComplexType(XmlSchemaComplexType ct, DataTable table, ArrayList tableChildren, Boolean isNillable)
at System.Data.XSDSchema.InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, Boolean isRef)
at System.Data.XSDSchema.HandleTable(XmlSchemaElement node)
at System.Data.XSDSchema.HandleParticle(XmlSchemaParticle pt, DataTable table, ArrayList tableChildren, Boolean isBase)
at System.Data.XSDSchema.HandleComplexType(XmlSchemaComplexType ct, DataTable table, ArrayList tableChildren, Boolean isNillable)
at System.Data.XSDSchema.InstantiateTable(XmlSchemaElement node, XmlSchemaComplexType typeNode, Boolean isRef)
at System.Data.XSDSchema.HandleTable(XmlSchemaElement node)
at System.Data.XSDSchema.HandleDataSet(XmlSchemaElement node, Boolean isNewDataSet)
at System.Data.XSDSchema.LoadSchema(XmlSchemaSet schemaSet, DataSet ds)
at System.Data.DataSet.InferSchema(XmlDocument xdoc, String[] excludedNamespaces, XmlReadMode mode)
at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)
at System.Data.DataSet.ReadXml(Stream stream)
at uJ.a(XmlDocument a)
at WL.a(XmlDocument a)
at WL.a(String a, MM b)
at NM.a(String a, Stream b, MM c)
at NM..ctor(Stream a, MM b)
at Aspose.Words.Reporting.JsonDataSource..ctor(Stream jsonStream, JsonDataLoadOptions options)
at Aspose.Words.Reporting.JsonDataSource..ctor(Stream jsonStream)
The error also occurs on the latest version - 24.10.0
Is there a chance to get this bug fixed in the next version?
Is there any solution in the current version to make such json work properly?
I do not hide that I am very concerned about this, because in our software the sources are dynamic and we do not have full control over the json content, so normalizing json to eliminate this bug may not be possible.
Thank you for your help.