Page 1 of 1

Relations not automatically generated?

Posted: Wed Jun 04, 2008 6:17 am
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

Relations not automatically generated?

Posted: Wed Jun 04, 2008 10:35 am
by Edward
The issue is confirmed. It was a mistake in our prerelease build.

Please download the latest prerelease from our site.

Thank you.

Relations not automatically generated?

Posted: Thu Jun 05, 2008 3:23 am
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

Relations not automatically generated?

Posted: Mon Jun 09, 2008 4:13 pm
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.