Relationship not working
Relationship not working
v2009.3.600
Framework v2.0.50727
I have DataBand1 (DataSource1) surrounded by GroupHeader1 and GroupFooter1. GroupHeader1's Sort property=None, Condition={CompanyID} Inside GroupFooter1 I have a Panel1. Inside Panel1 I have DataBand2 (DataSource2) surrounded by HeaderBand1 and FooterBand1. I have a Relationship1 between DataSource1 and DataSource2 on a CompanyID column. DataBand2 has Databand1 set as the master and relationship set to Relationship1.
Both datasources are not populated from a SQL query, instead a .NET dataset is built with datatables corresponding to the 2 databand datasources. Both datatables are registered with regData
DataBand1 displays the data as intended but the child (DataBand2) displays the entire recordset (DataSource2) instead of only data for the current CompanyID. If I completely remove the relationship I get the same report, it is as if my relationship is being ignored.
Thanks for your help
Scot
Framework v2.0.50727
I have DataBand1 (DataSource1) surrounded by GroupHeader1 and GroupFooter1. GroupHeader1's Sort property=None, Condition={CompanyID} Inside GroupFooter1 I have a Panel1. Inside Panel1 I have DataBand2 (DataSource2) surrounded by HeaderBand1 and FooterBand1. I have a Relationship1 between DataSource1 and DataSource2 on a CompanyID column. DataBand2 has Databand1 set as the master and relationship set to Relationship1.
Both datasources are not populated from a SQL query, instead a .NET dataset is built with datatables corresponding to the 2 databand datasources. Both datatables are registered with regData
DataBand1 displays the data as intended but the child (DataBand2) displays the entire recordset (DataSource2) instead of only data for the current CompanyID. If I completely remove the relationship I get the same report, it is as if my relationship is being ignored.
Thanks for your help
Scot
- Attachments
-
- 367.PayrollEdit.mrt
- (103.78 KiB) Downloaded 220 times
Relationship not working
Hello,
We couldn't reproduce this bug on our reports.
Sorry, can you provide data for your report or sample project for this issue?
Thank you.
We couldn't reproduce this bug on our reports.
Sorry, can you provide data for your report or sample project for this issue?
Thank you.
- Attachments
-
- 369.Report sample.zip
- (2.23 KiB) Downloaded 191 times
Relationship not working
Here is a sample that reproduces the problem
Thank you for your help, this is important
Thank you for your help, this is important
- Attachments
-
- 371.StimulsoftIssue.zip
- (90.96 KiB) Downloaded 212 times
Relationship not working
Here is a project that reproduces the problem.
Thank you for looking at this, it is important
Thank you for looking at this, it is important
- Attachments
-
- 372.StimulsoftIssue.zip
- (94.4 KiB) Downloaded 190 times
Relationship not working
Hello,
Thank you.
Please modify your code:scot wrote:Here is a project that reproduces the problem.
Code: Select all
'load the report
Dim loReport = New Stimulsoft.Report.StiReport
loReport.Load(Application.StartupPath & "\payrolledit.mrt")
loReport.DataSources.Clear()
'pass in each dataset table
For Each ldtTable As DataTable In mdtDataSet.Tables
loReport.RegData(ldtTable.TableName.ToString, ldtTable)
Next
'make report aware of new dataset columns
loReport.Dictionary.Synchronize()
loReport.Dictionary.RegRelation(New StiDataRelation("EmployeePTSummary", loReport.Dictionary.DataSources("Employee"), loReport.Dictionary.DataSources("PTSummary"), New String() {"Company_Num"}, New String() {"Company_Num"}))
loReport.Dictionary.RegRelation(New StiDataRelation("EmployeeDistributionSummary", loReport.Dictionary.DataSources("Employee"), loReport.Dictionary.DataSources("DistributionSummary"), New String() {"Company_Num"}, New String() {"Company_Num"}))
'make report aware of new relations
loReport.Dictionary.Synchronize()
Dim loDatabandMaster = DirectCast(loReport.GetComponentByName("DataBand"), Stimulsoft.Report.Components.StiDataBand)
Dim loChildDataband1 = DirectCast(loReport.GetComponentByName("CompanyPTDataBand"), Stimulsoft.Report.Components.StiDataBand)
loChildDataband1.MasterComponent = loDatabandMaster
loChildDataband1.DataRelationName = "EmployeePTSummary"
Dim loChildDataband2 = DirectCast(loReport.GetComponentByName("CompanyDistributionDataBand"), Stimulsoft.Report.Components.StiDataBand)
loChildDataband2.MasterComponent = loDatabandMaster
loChildDataband2.DataRelationName = "EmployeeDistributionSummary"
'pass in each parameter we cared to specify
For Each loParameter As Parameter In moParameters
loReport.Dictionary.Variables.Add(New StiVariable(loParameter.Name, loParameter.Value))
Next
With Me.rptViewer
.Dock = DockStyle.Fill
.Visible = True
.Report = loReport
.Report.Render()
End With
Relationship not working
Thank you, it works now!
Relationship not working
We are always ready to help you! :biggrin: