Title: CrystalReportViewer Control code                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using CrystalDecisions.CrystalReports.Engine;
using System.Windows.Forms;
 
namespace WindowsFormsApplication1
{
    public partial class frmCrystalReportViewer : Form
    {
        public frmCrystalReportViewer()
        {
            InitializeComponent();
        }
  private void frmCrystalReportViewer_Load(object sender, EventArgs e)
        {       
           //Connect to the Database
    string constring = "Server=(local);Database=my;User Id=sa;Password=sa";
            SqlConnection sqlcon = new SqlConnection(constring);
            //Open the connection
            sqlcon.Open();
            SqlCommand cmd = new SqlCommand();
            SqlDataAdapter da = new SqlDataAdapter();
            //Write the query
            cmd.CommandText = "select * from regform";
            da.SelectCommand = cmd;
            cmd.Connection = sqlcon;
            da.SelectCommand = cmd;
            //create a dataset
            DataSet ds = new DataSet();
            da.Fill(ds);
        //Create Crystal report document
            ReportDocument rptdc = new ReportDocument();
     //Set crystal report path
    rptdc.Load("C:\\User\\WindowsFormsApplication1\\CrystalReport1.rpt");
           //Bind dataset to reportdoucument
            rptdc.SetDataSource(ds);
           //Bind ReportSource to crystalReportViewer
           crystalReportViewer1.ReportSource = rptdc;
        }
    }
}