I am new in C#.
I fetch data from SQL and show it in a crystal report. After that I want to save that data which is shown in crystal report viewer. I have fetch data and show it in crystal report using Query. the coding is like this
con.Open();
string str = comboBox1.Text;
SqlCommand cmd = new SqlCommand("Select Emp_cod,projectId,projc_name,Description,StartDateOfProjct,EndDateOfProjct from Projct_Allocation where projectId=@id", con);
cmd.Parameters.Add(new SqlParameter("id", str));
SqlDataAdapter da = new SqlDataAdapter(cmd);
SqlCommandBuilder cmb = new SqlCommandBuilder(da);
DataSet2 ds = new DataSet2();
da.Fill(ds, "DataTable1");
CrystalReport2 ctr2 = new CrystalReport2();
ctr2.SetDataSource(ds);
crystalReportViewer1.ReportSource = ctr2;
This code run correctly. But after that I could not able to save data in Excel/PDF file which is shown in crystalReportViewer1.
I tried a lot but could not able to do this.
Please help me I would be very grateful to you.
Please!!!!!!!!!!!!!!!!!!!!!
[edit]Code block added - OriginalGriff[/edit]