or
Private Function BuildParamList(ByVal paramType As String) As String Dim list As String = "" Dim count As Integer = 0 For Each val As Integer In CType(Me.ReportParameters(paramType).Value(), Array) If count = 0 Then list = val.ToString Else list = list + "," + val.ToString() End If count = count + 1 Next Return list End Function Private Sub AppDetailByRole_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource 'retrieve the data into the dataset Try Me.UsP_AppDetailByRoleContextTableAdapter1.Fill(Me.DataSet21.USP_AppDetailByRoleContext, _ BuildParamList("Application"), _ BuildParamList("Environment"), _ BuildParamList("Role")) TryCast(sender, Telerik.Reporting.Processing.Report).DataSource = Me.DataSet21.USP_AppDetailByRoleContext Catch ex As System.Exception 'An error has occurred while filling the data set. Please check the exception for more information. System.Diagnostics.Debug.WriteLine(ex.Message) End Try End SubTelerik.Reporting.Processing.Chart chart = (Telerik.Reporting.Processing.Chart)sender; Telerik.Reporting.Chart chartDef = (Telerik.Reporting.Chart)chart.ItemDefinition; Telerik.Reporting.Charting.ChartSeries series = new Telerik.Reporting.Charting.ChartSeries(); while (dtThisDate <= dtEndDate) { seriesItem = new Telerik.Reporting.Charting.ChartSeriesItem(); seriesItem.YValue = (long)barvalue; seriesItem.Label.TextBlock.Appearance.TextProperties.Color = Color.Black; series.AddItem(seriesItem); chartDef.PlotArea.XAxis.Items.Add(new ChartAxisItem(dtThisDate.Month.ToString() + "/" + dtThisDate.Day.ToString() + "/" + dtThisDate.Year.ToString())); } if (targetParm != "" && targetParm != "0") { Telerik.Reporting.Charting.ChartMarkedZone mzone = new ChartMarkedZone(); mzone.ValueStartY = Convert.ToInt32(targetParm); mzone.ValueEndY = Convert.ToInt32(targetParm); mzone.ValueStartX = chartDef.PlotArea.XAxis.MinValue; mzone.ValueEndX = chartDef.PlotArea.XAxis.MaxValue; mzone.Appearance.Border.Color = Color.Red; mzone.Appearance.Border.Width = 3; chartDef.PlotArea.Add(mzone); }mzone.ValueStartX = chartDef.PlotArea.XAxis.MinValueprivate
void TableReport_ItemDataBinding(object sender, EventArgs e)
{
Telerik.Reporting.Processing.
ReportItemBase item = (Telerik.Reporting.Processing.ReportItemBase)sender;
string daysAnalysis = item.DataObject["intDaysAnalysis"].ToString(); ----> This line throws exception where item.DataObject is null
}