Click here to Skip to main content
15,886,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All, need help on the developed c sharp windows application for reports. I have added the crystal report and crystal report viewer, i am getting blank datas generated in reports, below is the code. Kindly help on this please

private void button3_Click(object sender, EventArgs e)
        {
            SqlConnection dbconnect = new SqlConnection();
            string sql = null;
            
            dbconnect.ConnectionString = @"Data Source=JP-PC\SQLEXPRESS;Initial Catalog=FTSSCRIBETECH;Integrated Security=True;";
            try
            {
                dbconnect.Open();
                CrystalReport13 CR;
                CR = new CrystalReport13();
                sql = "SELECT 'TRUSTID','SUM(UPLOADLNCNT)' FROM DCLIVEJOBS GROUP BY TRUSTID";

                SqlDataAdapter sda = new SqlDataAdapter(sql, dbconnect);
                
                DataSet ds = new DataSet();
                sda.Fill(ds, "DataSet1");
                CR.SetDataSource(ds);
                
              

                crystalReportViewer1.ReportSource = CR;
                crystalReportViewer1.Refresh();


                dbconnect.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Posted

1 solution

There are couple of reasons. Already I have answered similar questions. See that

Display data in crystal reports[^]
Crystal Report Blank / Empty / Not Displaying[^]
CrystalReport is not Viewed from Another Machine,[^]
 
Share this answer
 
Comments
jaipe 9-Aug-11 5:02am    
Hi, i had checked with the datatable and dataset, i am still not getting the report generated. Please help
thatraja 9-Aug-11 5:12am    
Please go through those 3 links(slowly) & let me know. Because those solutions solved the problems previous people.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900