This is a migrated thread and some comments may be shown as answers.

Help with the NeedDatasource event.

1 Answer 112 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Emil Eriksson
Top achievements
Rank 1
Emil Eriksson asked on 17 Aug 2009, 06:41 PM
I dont know what I have done wrong. I have a chart, the chart needs a datasource. This is my NeedDataSource-method

private

 

void companyBooking_NeedDataSource(object sender, System.EventArgs e)

 

{

Telerik.Reporting.Processing.

Chart companyBookingChart = sender as Telerik.Reporting.Processing.Chart;

 

companyBookingChart.DataSource =

this.bokadoktornDataSetTableAdapter1.GetData();

 

}

In the InitializeComponent()-method I have this eventHandler.
this.companyBookingChart.NeedDataSource += new System.EventHandler(this.companyBooking_NeedDataSource);

This is my database-sqlquery, (Works fine)

SELECT YEAR(BookedDate) AS Year, MONTH(BookedDate) AS Month, CONCAT(u.FirstName, ' ', u.LastName) AS FullName, Count(*) AS NoOfBookings
FROM         Bookings b
INNER JOIN Users u ON u.Id = b.BookedById
INNER JOIN CompanyUsers cu ON cu.Id = u.Id
WHERE cu.CompanyId = 1
GROUP BY u.Id, MONTH(BookedDate), YEAR(BookedDate)
ORDER BY NoOfBookings DESC;

When I preview my report nothing happends. I dont know why, everything worked fine until I added my chart. Is it something wrong with my NeedDataSource-method.

Thanks
/Emil

 

1 Answer, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 18 Aug 2009, 09:59 AM
Hello Emil Eriksson,

From what you have sent the problem is not in this code. Please check the Output window for any exceptions and try to debug the application to make sure that everything is properly initialized and called.

Greetings,
Chavdar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Emil Eriksson
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Share this question
or