Hi.
I'm using Telerik Reporting Q2 2012.
I want to create a chart which like attached image(chart.png).
Following is DataSource:
YEAR MARKET AMOUNT RATE
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2005 MARKET_A 38.98
2005 MARKET_B 326.9
2006 MARKET_A 48.36 24%
2006 MARKET_B 367.89 13%
2007 MARKET_A 59.13 22%
2007 MARKET_B 476.44 30%
2008 MARKET_A 75.27 27%
2008 MARKET_B 594.79 25%
2009 MARKET_A 92.75 23%
2009 MARKET_B 723.68 22%
2010 MARKET_A 25.15 -73%
2010 MARKET_B 192.56 -73%
I create four chartSeries objects (for two bars and two lines).
And set chart.DataGroupColumn to column "MARKET".
Designer.cs
private
void
InitializeComponent()
{
// variable initialize and detail design code
// ...
this
.chart1.Bindings.Add(
new
Telerik.Reporting.Binding(
"DataSource"
,
"= Fields.Data"
));
this
.chart1.DataGroupColumn =
"MARKET"
;
this
.chart1.DataSource =
this
.objectDataSource1;
this
.chart1.Docking = Telerik.Reporting.DockingStyle.Fill;
this
.chart1.IntelligentLabelsEnabled =
true
;
this
.chart1.Name =
"chart1"
;
this
.chart1.PlotArea.XAxis.AutoScale =
false
;
this
.chart1.PlotArea.XAxis.DataLabelsColumn =
"YEAR"
;
// create ChartSeries
chartSeries1.DataYColumn =
"AMOUNT"
;
chartSeries1.Name =
"Series 1"
;
chartSeries2.DataYColumn =
"AMOUNT"
;
chartSeries2.Name =
"Series 4"
;
chartSeries3.DataYColumn =
"RATE"
;
chartSeries3.Name =
"Series 2"
;
chartSeries3.YAxisType = Telerik.Reporting.Charting.ChartYAxisType.Secondary;
chartSeries4.DataYColumn =
"RATE"
;
chartSeries4.Name =
"Series 3"
;
chartSeries4.YAxisType = Telerik.Reporting.Charting.ChartYAxisType.Secondary;
this
.chart1.Series.AddRange(
new
Telerik.Reporting.Charting.ChartSeries[]
{
chartSeries1, chartSeries2, chartSeries3, chartSeries4
});
// objectDataSource1
this
.objectDataSource1.DataMember =
"Data"
;
this
.objectDataSource1.DataSource =
typeof
(SFuture.Common.Service.ReportModel);
this
.objectDataSource1.Name =
"objectDataSource1"
;
// Report1 design code
// ...
}
But it's not work.
Please take a look into the attached image(bad_chart.png).
Any idea?
Thank you for the support!
Public
Property
Param1()
As
Integer
Get
Return
DirectCast
(
Me
.SqlDataSource1.Parameters(
"@wo_id"
).Value,
Integer
)
End
Get
Set
(
ByVal
value
As
Integer
)
Me
.SqlDataSource1.Parameters(
"@wo_id"
).Value = value
End
Set
End
Property
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
Dim
wo_id
As
String
= Request(
"wo"
)
Dim
rpt =
New
WorkRequestRpt()
Dim
instanceReportSource =
New
Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument = rpt
rpt.Param1 =
CInt
(wo_id)
Me
.ReportViewer1.ReportSource = instanceReportSource
'New WorkRequestRpt()
ReportViewer1.RefreshReport()
End
Sub
This is slight different than the examples I saw because I kept getting an error that certain methods were now obsolete.
Every time I open the report it is just blank. I don't know if I need to use the Need_DataSource event or what. Also, do I need some parameter on the report? If I remove the parameter and just have a straight query it work fine. Something is not passing the vale to the SqlDataSource.
A real good example with all of the steps would be great (the video is hard to follow, especially with some of the methods becoming obsolete). I think it would also help a lot of other out.
<
span
style
=
"font-family: 'pluto light';"
>Test</
span
>