Two Relations with the same name in datasource
Two Relations with the same name in datasource
Hello, I'm using a DataSet as source for the report.
The DataSet has a few relations, but all with diferent names. But in the datasource in report two relations have the same name. (Name in datasource is different, but not the name). This causes an error in the viewer. How can I influence this? Where does this name came from?
My designer version isr 2021.3.4
Thanks in advance
The DataSet has a few relations, but all with diferent names. But in the datasource in report two relations have the same name. (Name in datasource is different, but not the name). This causes an error in the viewer. How can I influence this? Where does this name came from?
My designer version isr 2021.3.4
Thanks in advance
- Attachments
-
- Screenshot_2.png (41.21 KiB) Viewed 2901 times
-
- Posts: 6329
- Joined: Tue Mar 20, 2018 5:34 am
Re: Two Relations with the same name in datasource
Hello,
Please clarify how do you add these relations?
Thank you.
Please clarify how do you add these relations?
Thank you.
Re: Two Relations with the same name in datasource
Hi, thats the code how I add the relation. The name of the relation is always different to the others. I've tried variants without exception, but the behavior is the same. The property "Name in datasource" is in both relation correct, but not the property "Name is the same.
Thanks Thomas
DataRelation relation =
new DataRelation(
ownTableName + "_" + atrDescr.OwnPropertyName + "_" + otherTableName,
parentColumn,
childColumn, false);
try
{
// if (reportDataSet.Relations.Contains(relation.RelationName) == false)
reportDataSet.Relations.Add(relation);
}
catch (Exception)
{
try
{
// this can be happen if 2 relations to the same type are defined, for instance visit <-> person
string ownPropName = atrDescr.OwnPropertyName;
relation.RelationName = ownTableName + "_" + ownPropName + "_" +
childColumn.ColumnName;
// if (reportDataSet.Relations.Contains(relation.RelationName) == false)
reportDataSet.Relations.Add(relation); // log message if something went wrong !
}
catch (Exception ex1)
{
Log.Debug("Can't create relation \"" + relation.RelationName + "\"in report data set", ex1);
}
Thanks Thomas
DataRelation relation =
new DataRelation(
ownTableName + "_" + atrDescr.OwnPropertyName + "_" + otherTableName,
parentColumn,
childColumn, false);
try
{
// if (reportDataSet.Relations.Contains(relation.RelationName) == false)
reportDataSet.Relations.Add(relation);
}
catch (Exception)
{
try
{
// this can be happen if 2 relations to the same type are defined, for instance visit <-> person
string ownPropName = atrDescr.OwnPropertyName;
relation.RelationName = ownTableName + "_" + ownPropName + "_" +
childColumn.ColumnName;
// if (reportDataSet.Relations.Contains(relation.RelationName) == false)
reportDataSet.Relations.Add(relation); // log message if something went wrong !
}
catch (Exception ex1)
{
Log.Debug("Can't create relation \"" + relation.RelationName + "\"in report data set", ex1);
}
-
- Posts: 6329
- Joined: Tue Mar 20, 2018 5:34 am
Re: Two Relations with the same name in datasource
Hello,
Please send us a sample project that reproduces the issue for analysis.
Thank you.
Please send us a sample project that reproduces the issue for analysis.
Thank you.
Re: Two Relations with the same name in datasource
Hi, I'll do it, but it is complicated to make a project wich is intepentend for our database an for other projects.
Perhaps this information will help.
Both of those relations are between the same two tables, but the property is different.(this is needed because of the internal structure)
If I do the same thing windowsDesigner, not the webDesigner, ist works as expectet (see att., Name and Name in Datasource are identical.
Perhaps this will help
Thanks Thomas
Perhaps this information will help.
Both of those relations are between the same two tables, but the property is different.(this is needed because of the internal structure)
If I do the same thing windowsDesigner, not the webDesigner, ist works as expectet (see att., Name and Name in Datasource are identical.
Perhaps this will help
Thanks Thomas
- Attachments
-
- Screenshot_3.png (25.1 KiB) Viewed 2789 times
-
- Posts: 6329
- Joined: Tue Mar 20, 2018 5:34 am
Re: Two Relations with the same name in datasource
Hello,
It is difficult to say something without a sample.
Thank you.
It is difficult to say something without a sample.
Thank you.
Re: Two Relations with the same name in datasource
Hi again, sorry for the delay
If you start the attached sample project you can see the double names in the datasource, as shown in the earlier posted screenshot. (Screenshot_2.png)
The solution is based on the sample on your webpage.
Thanks in advance
Thomas
If you start the attached sample project you can see the double names in the datasource, as shown in the earlier posted screenshot. (Screenshot_2.png)
The solution is based on the sample on your webpage.
Thanks in advance
Thomas
-
- Posts: 6329
- Joined: Tue Mar 20, 2018 5:34 am
Re: Two Relations with the same name in datasource
Hello,
There are no projects in attachments.
Thank you.
There are no projects in attachments.
Thank you.
Re: Two Relations with the same name in datasource
But now, I think
- Attachments
-
- IF_SampleDatasource.zip
- (21.62 MiB) Downloaded 172 times
-
- Posts: 6329
- Joined: Tue Mar 20, 2018 5:34 am
Re: Two Relations with the same name in datasource
Hello,
We couldn't reproduce the issue. Please provide more detailed information.
Thank you.
We couldn't reproduce the issue. Please provide more detailed information.
Thank you.