Free Support Forum - aspose.com

Double relation to same DataTable with LINQ Reporting Engine

Hello,
I need to manage two DataTables which are connected with two different relations, but I cannot find a way to do this.

I created a simple example with a TextBlock class/table which has two properties (ForeColor and BackColor) which point to the same CustomColor class/table.

With custom classes you can simply use this syntax:

<<foreach [textBlock in textBlocks]>> <<[ForeColor.Name]>> on <<[BackColor.Name]>> <</foreach>>

With DataTables I tried with several options, but none of them worked.

  1. Obviously you cannot use TableName (as with single relations) because it would be ambiguous:

<<foreach [textBlock in TextBlocks]>> Ambiguous: <<[CustomColors.Name]>> <</foreach>>

  1. Using RelationName:

<<foreach [textBlock in TextBlocks]>> <<[ForeColor.Name]>> on <<[BackColor.Name]>> <</foreach>>

  1. Using GetParentRow(“RelationName”):

<<foreach [textBlock in TextBlocks]>> <<[GetParentRow("ForeColor").Name]>> on <<[GetParentRow("BackColor").Name]>> <</foreach>>

  1. Using GetParentRows(“RelationName”):

<<foreach [textBlock in TextBlocks]>> <<[GetParentRows("ForeColor").Name]>> on <<[GetParentRows("BackColor").Name]>> <</foreach>>

  1. Using GetChildRows(“RelationName”):

<<foreach [textBlock in TextBlocks]>> <<[GetChildRows("ForeColor").Name]>> on <<[GetChildRows("BackColor").Name]>> <</foreach>>

Is there a solution to this?
Probably it would be nice if you could use the RelationName to navigate to other tables.

Attached you can find all the tests I did: Aspose.Words - DoubleRelation.zip (812.2 KB)

@agarberi

We have logged this feature request as WORDSNET-19238 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

Hello,
do you have an estimated time for this feature to be implemented?
Unfortunately we have may of these cases in our DB.

Do you know if there is an alternative solution we can use in the meanwhile?
For example, do you know if it is possible to use DataViews to simulate that the two properties point to 2 different tables (also if it is the same one with 2 views)? That is (following the example) make “ForeColor” and “BackColor” be 2 DataViews of table “CustomColors”, then link “TextBlock” with the 2 DataViews. Can a DataRelation be used with DataViews instead of DataTables?

Thank you for your help.

@agarberi

We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. We work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, your issue is under “In Development” phase. Unfortunately, there is no ETA available for this issue at the moment. However, we will inform you via this forum thread once there is an update available on it.

Unfortunately, there is no alternative solution of this feature. Please wait for the fix of this issue. We will share the good news with you soon.

I know you have many requests, I just wanted an approximate idea of the time, because this is critical for our reports.

Anyway I’m glad to know that you are already implementing it!

Thanks

@agarberi

We have good news for you i.e. WORDSNET-19238 has now been resolved. This feature will be included in the next version of Aspose.Words i.e. 19.12. We will inform you via this forum thread as soon as the next version of Aspose.Words is available.

Thank you very much for the rapid implementation!

I noticed that the new version come out and I tried it (although there has been no notification from the forum thread).

It works as expected using relation names.

@agarberi

Thanks for your feedback. It is nice to hear from you that resolution of WORDSNET-19238 works for you. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.