Hi All,
I'm new on using Telerik Reports. I'm just wondering how can I get the ObjectDatasource of my Master to my Subreport.
I have used this code from the documentation and it works fine when I use it directly to a report but when its being used to a master, cant seem to pass the datasource.
Dim objectDataSource As New Telerik.Reporting.ObjectDataSource()
objectDataSource.DataSource = GetMyData() ' GetData returns a SqlDataAdapter object which has a select command with three SELECT statements.
objectDataSource.DataMember = "Table2" ' Indicating the exact table to bind to. If the DataMember is not specified the first data table will be used.
objectDataSource.CalculatedFields.Add(New Telerik.Reporting.CalculatedField("FullName", GetType(String), "=Fields.Name + ' ' + Fields.ProductNumber")) ' Adding a sample calculated field.
'Creating a new report
Dim report As New Telerik.Reporting.Report()
' Assigning the ObjectDataSource component to the DataSource property of the report.
report.DataSource = objectDataSource
' Use the InstanceReportSource to pass the report to the viewer for displaying.
Dim reportSource As new InstanceReportSource
reportSource.ReportDocument = report
' Assigning the report to the report viewer.
reportViewer1.ReportSource = reportSource
' Calling the RefreshReport method in case this is a WinForms application.
Me.reportViewer1.RefreshReport()
Please note that using vb code, Report Q3 2013 and I wonder why Subreport.ReportSource.Datasource is not available
Any help would greatly appreciated,
Thanks in advance,
RJ
I'm new on using Telerik Reports. I'm just wondering how can I get the ObjectDatasource of my Master to my Subreport.
I have used this code from the documentation and it works fine when I use it directly to a report but when its being used to a master, cant seem to pass the datasource.
Dim objectDataSource As New Telerik.Reporting.ObjectDataSource()
objectDataSource.DataSource = GetMyData() ' GetData returns a SqlDataAdapter object which has a select command with three SELECT statements.
objectDataSource.DataMember = "Table2" ' Indicating the exact table to bind to. If the DataMember is not specified the first data table will be used.
objectDataSource.CalculatedFields.Add(New Telerik.Reporting.CalculatedField("FullName", GetType(String), "=Fields.Name + ' ' + Fields.ProductNumber")) ' Adding a sample calculated field.
'Creating a new report
Dim report As New Telerik.Reporting.Report()
' Assigning the ObjectDataSource component to the DataSource property of the report.
report.DataSource = objectDataSource
' Use the InstanceReportSource to pass the report to the viewer for displaying.
Dim reportSource As new InstanceReportSource
reportSource.ReportDocument = report
' Assigning the report to the report viewer.
reportViewer1.ReportSource = reportSource
' Calling the RefreshReport method in case this is a WinForms application.
Me.reportViewer1.RefreshReport()
Please note that using vb code, Report Q3 2013 and I wonder why Subreport.ReportSource.Datasource is not available
Any help would greatly appreciated,
Thanks in advance,
RJ