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

Business Object Binding Error

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lorenzo
Top achievements
Rank 1
Lorenzo asked on 16 May 2009, 05:03 PM

Hi

I configure the report with no DataSource and the following NeedDataSource event:

 

private void AnalisiSconfinamenti_NeedDataSource(object sender, EventArgs e)  
        {  
            WSClass ws = new WSClass();  
            List<Analisi> elenco = null;  
            elenco = ws.analisi(9, new DateTime(2008, 5, 20), new DateTime(2009, 5, 20));  
 
            (sender as Telerik.Reporting.Processing.Report).DataSource = elenco;  
              
        } 

 

 


The method ws.analisi is the following

 

public List<Analisi> analisi(int id_cliente, DateTime fromData, DateTime toData)  
        {  
            UnicaDataContext db = new UnicaDataContext();  
            //linq query to db  
            var elencoFC = from e in db.Analisis ............  
 
            return elencoFC.toList();  
        } 


When I preview the report I have the follow error:

Object reference not set to an instance of an object.


Where is the problem?

Thanks
Lorenzo

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 18 May 2009, 04:32 PM
Hello Lorenzo,

Are you able to bind a datagrid control with the datasource you've provided successfully? If this is the case please provide us with a sample runnable project, where we can observe the erroneous behavior and we would be able to advise you accordingly.

Best wishes,
Steve
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
Lorenzo
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or