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

Telerik Report Bind with Linq

1 Answer 136 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
vikas
Top achievements
Rank 1
vikas asked on 22 Mar 2012, 02:00 PM
Hi,

I want to display the data into telerik report viewer control through the Linq with stored procedure.

I have tried this but not get the success. 

Telerik report viewer showing as blank.

I used this source code also without LInq

 Telerik.Reporting.ObjectDataSource objectDataSource = new Telerik.Reporting.ObjectDataSource();
            objectDataSource.DataSource = GetAllData(); // GetData returns a DataSet with three tables
            objectDataSource.DataMember = "VehiclePlanInformation"; /// Indicating the exact table to bind to. If the DataMember is not specified the first data table will be used.
             
            //  objectDataSource.CalculatedFields.Add(new Telerik.Reporting.CalculatedField("PlanCode", typeof(string), "=Fields.PlanCode")); // Adding a sample calculated field.


            // Creating a new report
            Telerik.Reporting.Table report = new Telerik.Reporting.Table();


            // Assigning the ObjectDataSource component to the DataSource property of the report.
            report.DataSource = objectDataSource;
            
            // Assigning the report to the report viewer.
            ReportViewer1.Report =(Telerik.Reporting.IReportDocument)report;


            // Calling the RefreshReport method (only in WinForms applications).
            ReportViewer1.RefreshReport();

but not get the success.

Please suggest me. Its urgent for me.


Thanks

Vikas

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 26 Mar 2012, 12:34 PM
Hi Vikas,

Telerik Reporting uses a report definition that is processed internally by the engine in multiple stages. For more information check out the Report Life Cycle help article. The report definition is generated by the Visual Studio or the stand alone Telerik Report Designer. Check out the Quickstart help articles and let us know if you experience any further difficulties.

Generally the IReportDocument interface is implemented by Telerik.Reporting.Report and Telerik.Reporting.ReportBook. 

Greetings,
Peter
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
vikas
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or