Hello,
In general I am very please with telerik; however, it seems like VB.NET is an afterthought in regards to samples...
The following is the code supplied for VB.NET to connect a chart to a datasource and seems useless as far as correct code....not that it can't be modified but just a bit annoying.
This is from ms-help://telerik.reporting.3.2/Reporting/BuildingDatabindDatabase.html
John
In general I am very please with telerik; however, it seems like VB.NET is an afterthought in regards to samples...
The following is the code supplied for VB.NET to connect a chart to a datasource and seems useless as far as correct code....not that it can't be modified but just a bit annoying.
This is from ms-help://telerik.reporting.3.2/Reporting/BuildingDatabindDatabase.html
| Imports System |
| Imports Telerik.Reporting.Chart |
| Public Partial Class Report1 |
| Inherits Report |
| Public Sub New() |
| """ <summary> |
| """ Required for telerik Reporting designer support |
| """ </summary> |
| InitializeComponent() |
| End Sub |
| Private Sub chart1_NeedDataSource(sender As Object, e As System.EventArgs) |
| " create a datasource |
| Dim sqlDataSource As New SqlDataSource() |
| sqlDataSource.ID = "myDataSource" |
| sqlDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString |
| sqlDataSource.SelectCommand = "SELECT CategoryName, SUM(ProductSales) AS TotalSales FROM [Product Sales for 1997] GROUP BY CategoryName" |
| Dim procChart As Telerik.Reporting.Processing.Chart = DirectCast(sender, Telerik.Reporting.Processing.Chart) |
| procChart.DataSource = "myDataSource" |
| " Set the column for data and data labels: |
| " Each bar will show "TotalSales", each label along |
| " X-axis will show "CategoryName. |
| chart1.Series(0).DataYColumn = "TotalSales' |
| chart1.PlotArea.XAxis.DataLabelsColumn = 'CategoryName' |
| " assign appearance related properties |
| chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300 |
| chart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.BlueViolet |
| chart1.PlotArea.Appearance.Dimensions.Margins.Bottom = Telerik.Reporting.Charting.Styles.Unit.Percentage(30) |
| End Sub |
| End Sub |
| End Class |
John