Hi,
I'm trying to create a chart in my report but getting:
An error has occured while processing Chart 'chart1':
Could not load type 'DO.ReportBars' from assembly 'DO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
The class is very simple:
And the chart code:
The strange thing is that it works if I move the ReportBars class to the same namespace as the report so the ReportBars is not placed in a different assembly.
I'm trying to create a chart in my report but getting:
An error has occured while processing Chart 'chart1':
Could not load type 'DO.ReportBars' from assembly 'DO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
The class is very simple:
namespace DO |
{ |
public class ReportBars |
{ |
public ReportBars() |
{ |
} |
public ReportBars(string name, int value) |
{ |
_name = name; |
_value = value; |
} |
private string _name; |
public string Name |
{ |
get { return _name; } |
set { _name = value; } |
} |
private int _value; |
public int Value |
{ |
get { return _value; } |
set { _value = value; } |
} |
} |
} |
And the chart code:
private void chart1_NeedDataSource(object sender, EventArgs e) |
{ |
Telerik.Reporting.Processing.Chart chart = (Telerik.Reporting.Processing.Chart)sender; |
Telerik.Reporting.Chart chartDef = (Telerik.Reporting.Chart)chart.ItemDefinition; |
List<DO.ReportBars> bars = new List<DO.ReportBars>(); |
bars.Add(new DO.ReportBars("Parka L", 120)); |
bars.Add(new DO.ReportBars("Parka M", 100)); |
bars.Add(new DO.ReportBars("Parka S", 132)); |
bars.Add(new DO.ReportBars("Wool Cap", 45)); |
bars.Add(new DO.ReportBars("Mittens", 67)); |
chartDef.Series.Clear(); |
ChartSeries s = new ChartSeries(); |
s.Type = ChartSeriesType.Bar; |
chartDef.Series.Add(s); |
s.DataYColumn = "Value"; |
s.DataLabelsColumn = "Name"; |
chart.DataSource = bars; |
} |
The strange thing is that it works if I move the ReportBars class to the same namespace as the report so the ReportBars is not placed in a different assembly.