I am working with reports with multiple tables and relations in Silverlight 11.3, I am handling the tables, relations, and variables the following way. But it does not work. Though the report dictionary is getting datasource, tables, relations. The viewer shows only variables no data. Please let me know what wrong here. Note that, this works fine with reports with single table.
Code: Select all
Public Function LoadReport()
'
'
'
'
'
InvokePreviewDataSet()
report.Load(strm)
For t As Integer = 0 To PreviewDataset.Tables.Count - 1
PreviewDataset.Tables(t).TableName = report.Dictionary.DataSources.Item(t).ToString()
Next
Dim CalColList As New ArrayList
Dim VariableList As New ArrayList
Dim RelationList As New ArrayList
For i As Integer = 0 To report.Dictionary.DataSources(0).Columns.Count - 1
Dim Col As Object = report.Dictionary.DataSources(0).Columns(i)
If Col.GetType.Name = "StiCalcDataColumn" Then
CalColList.Add(Col)
End If
Next
For i As Integer = 0 To report.Dictionary.Variables.Count - 1
Dim Var As Object = report.Dictionary.Variables(i)
If Var.GetType.Name = "StiVariable" Then
VariableList.Add(Var)
End If
Next
For r As Integer = 0 To report.Dictionary.Relations.Count - 1
Dim Rel As Object = report.Dictionary.Relations(r)
If Rel.GetType.Name = "StiDataRelation" Then
RelationList.Add(Rel)
End If
Next
report.Dictionary.Databases.Clear()
report.Dictionary.DataSources.Clear()
report.Dictionary.Variables.Clear()
report.Dictionary.Relations.Clear()
report.RegData(preview_Dataset)
report.Dictionary.Synchronize()
'Add CalcCols
For Each CalCol As Dictionary.StiCalcDataColumn In CalColList
report.Dictionary.DataSources(0).Columns.Add(CalCol)
Next
'Add Variables
For Each var As Dictionary.StiVariable In VariableList
report.Dictionary.Variables.Add(var)
Next
'Add Relations
For Each rel As Dictionary.StiDataRelation In RelationList
report.Dictionary.Relations.Add(rel)
Next
For Each Var In list
If list.Count > 0 Then
If report.Dictionary.Variables.Count > 0 Then
report.Dictionary.Variables(list.IndexOf(Var)).ValueObject = Var.CntVal
End If
End If
Next
report.Dictionary.Synchronize()
report.Render(False)
Return RenderingReportHelper.CheckReportOnInteractions(report, True)
End Function
Thank you
Irfan