Problem with Datarelation by code
Posted: Wed May 06, 2009 7:27 am
Hi there,
i have a problem setting a datarelation of the report by code. Problem is, when i open the Report with m_Stireport1.Design the Datarelation is not shown at my datasources.
Here is the example.
m_StiReport = New Stimulsoft.Report.StiReport
m_StiReport.Load(path)
Dim o As Object = m_StiReport.Dictionary.Relations.Clone()
m_StiReport.Dictionary.Databases.Clear()
m_StiReport.Dictionary.DataSources.Clear()
m_StiReport.Dictionary.Relations.Clear()
m_StiReport.RegData(m_Dataset)
m_StiReport.Dictionary.Synchronize()
m_StiReport.Dictionary.Relations = DirectCast(o, Stimulsoft.Report.Dictionary.StiDataRelationsCollection)
m_StiReport.Dictionary.RegRelations()
m_StiReport.Design()
Do i have to start "m_StiReport.Dictionary.Synchronize()" before setting the relation or after that ?.
Thx for your help.
Stephan
Edit:
I checked the code in the designer and i found that the relation is in the code. But it's not visible at my Datasources.
Private Sub InitializeComponent()
Me.WaWi_VKBelegePositionen = New WaWi_VKBelegePositionenDataSource
Me.WaWi_VKBelegeSeriennummern = New WaWi_VKBelegeSeriennummernDataSource
Me.ParentBelPoszuSrn = New Stimulsoft.Report.Dictionary.StiDataRelation("BelPoszuSrn", "BelPoszuSrn", "BelPoszuSrn", Me.WaWi_VKBelegePositionen, Me.WaWi_VKBelegeSeriennummern, New System.String() {"ID"}, New System.String() {"BelegPosID"})
i have a problem setting a datarelation of the report by code. Problem is, when i open the Report with m_Stireport1.Design the Datarelation is not shown at my datasources.
Here is the example.
m_StiReport = New Stimulsoft.Report.StiReport
m_StiReport.Load(path)
Dim o As Object = m_StiReport.Dictionary.Relations.Clone()
m_StiReport.Dictionary.Databases.Clear()
m_StiReport.Dictionary.DataSources.Clear()
m_StiReport.Dictionary.Relations.Clear()
m_StiReport.RegData(m_Dataset)
m_StiReport.Dictionary.Synchronize()
m_StiReport.Dictionary.Relations = DirectCast(o, Stimulsoft.Report.Dictionary.StiDataRelationsCollection)
m_StiReport.Dictionary.RegRelations()
m_StiReport.Design()
Do i have to start "m_StiReport.Dictionary.Synchronize()" before setting the relation or after that ?.
Thx for your help.
Stephan
Edit:
I checked the code in the designer and i found that the relation is in the code. But it's not visible at my Datasources.
Private Sub InitializeComponent()
Me.WaWi_VKBelegePositionen = New WaWi_VKBelegePositionenDataSource
Me.WaWi_VKBelegeSeriennummern = New WaWi_VKBelegeSeriennummernDataSource
Me.ParentBelPoszuSrn = New Stimulsoft.Report.Dictionary.StiDataRelation("BelPoszuSrn", "BelPoszuSrn", "BelPoszuSrn", Me.WaWi_VKBelegePositionen, Me.WaWi_VKBelegeSeriennummern, New System.String() {"ID"}, New System.String() {"BelegPosID"})