Working with reports having mutiple tables

Stimulsoft Reports.Silverlight discussion
Locked
sharpguy
Posts: 3
Joined: Mon Dec 26, 2011 1:21 am
Location: Saudi Arabia

Working with reports having mutiple tables

Post by sharpguy »

Hello,

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
Attachments
1574.Report and XmlData.rar
(297.96 KiB) Downloaded 351 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Working with reports having mutiple tables

Post by Alex K. »

Hello,

We couldn't reproduce this bug.
Can you please send us a sample project which reproduces the issue for analysis.

Thank you.
sharpguy
Posts: 3
Joined: Mon Dec 26, 2011 1:21 am
Location: Saudi Arabia

Working with reports having mutiple tables

Post by sharpguy »

Hello,

Thanks for your reply. Fortunately the problem has been solved by itself after several builds, without any change in the code, and it works fine now.


Thank you.
Anton Lozovskiy
Posts: 135
Joined: Tue Aug 11, 2009 9:38 am

Working with reports having mutiple tables

Post by Anton Lozovskiy »

Hello,

Let us know if you need any additional help.

Thank you.
Locked