Hi All -
I have a simple pie chart on a report that uses same datasource as the report. I can easily change the report datasource at runtime and all is well, but for some reason the chart throws the following (see attached). It works fine in preview in design mode, and all other reports I have bound with this method at runtime work perfectl. It is just adding the graph object I get this error. I have tried adding as subreport and just adding graph to report same issue -- it is loaded in the report footer. Here is the code I use to databind the report:
(NOTE: I am using a custom class and methods for getting data tables etc.. instantiated previously as db.)
Dim tbl As DataTable
tbl = db.GetDataTable("SELECT * FROM rpt_WholeProgram_Summary WHERE ProgramID = " & nProgramID)
Dim report1 As New BMETReports.WholeProgramSummary
report1.DataSource = tbl
'--------------- set Parameters -----------
'Get the Owner Name
Dim sOwnerName As String = db.GetSingleValue("SELECT IsNull(OwnerName,'owner name here') FROM Programs WHERE ProgramID = " & nProgramID)
report1.ReportParameters.Item("OwnerName").Value = sOwnerName
Dim sSubtitle As String = txtSubTitle.Text
Dim sProgramName As String = txtProgramName.Text
Dim sDraft As String = " "
If chkMarkDraft.Checked Then
sDraft = "DRAFT"
End If
report1.ReportParameters.Item("ProgramName").Value = sProgramName
report1.ReportParameters.Item("SubTitle").Value = sSubtitle
report1.ReportParameters.Item("Draft").Value = sDraft
'----------------------------------------------------
Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument = report1
ReportViewer1.ReportSource = instanceReportSource
I have a simple pie chart on a report that uses same datasource as the report. I can easily change the report datasource at runtime and all is well, but for some reason the chart throws the following (see attached). It works fine in preview in design mode, and all other reports I have bound with this method at runtime work perfectl. It is just adding the graph object I get this error. I have tried adding as subreport and just adding graph to report same issue -- it is loaded in the report footer. Here is the code I use to databind the report:
(NOTE: I am using a custom class and methods for getting data tables etc.. instantiated previously as db.)
Dim tbl As DataTable
tbl = db.GetDataTable("SELECT * FROM rpt_WholeProgram_Summary WHERE ProgramID = " & nProgramID)
Dim report1 As New BMETReports.WholeProgramSummary
report1.DataSource = tbl
'--------------- set Parameters -----------
'Get the Owner Name
Dim sOwnerName As String = db.GetSingleValue("SELECT IsNull(OwnerName,'owner name here') FROM Programs WHERE ProgramID = " & nProgramID)
report1.ReportParameters.Item("OwnerName").Value = sOwnerName
Dim sSubtitle As String = txtSubTitle.Text
Dim sProgramName As String = txtProgramName.Text
Dim sDraft As String = " "
If chkMarkDraft.Checked Then
sDraft = "DRAFT"
End If
report1.ReportParameters.Item("ProgramName").Value = sProgramName
report1.ReportParameters.Item("SubTitle").Value = sSubtitle
report1.ReportParameters.Item("Draft").Value = sDraft
'----------------------------------------------------
Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument = report1
ReportViewer1.ReportSource = instanceReportSource