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

data is not showing Report viewer

1 Answer 417 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sathish
Top achievements
Rank 1
Sathish asked on 14 Nov 2012, 07:16 AM
Hi .. 
I am Generating Data Report Using Telerik Report Viewer with out datasource .Instead of DataSource I am using Query To get the data .that data is assign to report . But The report is nothing displaying,  the code is like

  private void TeletikReport_Load(object sender, EventArgs e)
        {
              //// Creating and configuring the ObjectDataSource component:
          var objectDataSource = GetData();
            // Creating a new report
            Telerik.Reporting.Report report = new Telerik.Reporting.Report();
            report.DataSource = objectDataSource;                        
            // Use the InstanceReportSource to pass the report to the viewer for displaying
            Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();        
            reportSource.ReportDocument = report;
            // Assigning the report to the report viewer.
            reportViewer1.ReportSource = reportSource;
            //// Calling the RefreshReport method in case this is a WinForms application.
            reportViewer1.RefreshReport();
        }

        static DataView GetData()
        {
            const string connectionString = "Data Source=EMp;Initial Catalog=Emp;Integrated Security=True";
            string selectCommandText = "SELECT * FROM Emp;";
            SqlDataAdapter dataAdapter = new SqlDataAdapter(selectCommandText, connectionString);
            DataTable dataTable = new DataTable();
            dataAdapter.Fill(dataTable);
            DataView dataView = dataTable.DefaultView;
            return dataView;
        }

Please , Help  Where is the problem 


1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 16 Nov 2012, 01:18 PM
Hello Sathish,

The provided information is insufficient for us to determine what is the missing piece in your project. The report viewers only display Telerik Reports, they are not aware or related to the data, which is utilized only by the reports. Please go through the Quickstart help section that provides guidance how to create a simple report and display it in a viewer and if you're still having problems, we would appreciate if you elaborate on your scenario or provide a sample that we can look into.

Greetings,
Steve
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

Tags
General Discussions
Asked by
Sathish
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or