Relations not automatically generated?

Stimulsoft Reports.NET discussion
Post Reply
Neo77
Posts: 16
Joined: Thu Apr 10, 2008 4:13 am
Location: Switzerland

Relations not automatically generated?

Post by Neo77 »

Hi,

I have a Dataset with three tables and two relations designed and add it in the following way to my report

Code: Select all

DataSet set = ReportManager.GetDataSet(ViaContext, _Report.ReportType, reportSearch);

				StiReport stiReport = new StiReport();
				
				stiReport.RegData(set);

				stiReport.Load(_Report.ReportObject.BinaryData);
				
				// Clear
				stiReport.Dictionary.DataSources.Clear();
				stiReport.Dictionary.Relations.Clear();
				stiReport.Dictionary.Synchronize();

				ReportHelper.GenerateRelations(set, stiReport);

				stiDesigner.Report = stiReport;
The Problem is that my relations from the DataSet don't appear in the designer. I have to add them manually:

Code: Select all

foreach (DataRelation relation in set.Relations)
				{
					StiDataRelation stiRelation = new StiDataRelation(relation.RelationName, 
																	report.DataSources[relation.ParentTable.TableName],
																	report.DataSources[relation.ChildTable.TableName],
																	new string[] { relation.ParentColumns[0].ColumnName },
																	new string[] { relation.ChildColumns[0].ColumnName });

					report.Dictionary.Relations.Add(stiRelation);
				}
Are I am doing something wrong?

Regards,
Chris
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Relations not automatically generated?

Post by Edward »

The issue is confirmed. It was a mistake in our prerelease build.

Please download the latest prerelease from our site.

Thank you.
Neo77
Posts: 16
Joined: Thu Apr 10, 2008 4:13 am
Location: Switzerland

Relations not automatically generated?

Post by Neo77 »

Hi

Thanks! I can confirm that the relation are generate automatically now.

But...

The releation name is not the same as the name of the relation in the database.

For example:
Name in Source = Transmission.Type (like the relation name in the DataSet)
Name = ThesaurusTerms (like the tablename in the DataSet)
Alias = ThesaurusTerms (like the tablename in the DataSet)

As we have several relations to the same datatable (ThesaurusTerms) they
are listet in Dictionary as "ThesaurusTerms, ThesaurisTerms_2 [ThesaurusTerms], ...."
instead of "Transmissions.Type, Transmission.Status, ....".

Is there a way use the "Name in Source" for "Name" and "Alias"?

Best regards,
Chris
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Relations not automatically generated?

Post by Edward »

Initial name of the relation could be changed only in one case. When there is a relation with the same parent/child Columns in the Dictionary already.

Please delete all relations from the Dictionary and press Synchronize button again.

Thank you.
Post Reply