Irshad

Irshad

  • NA
  • 1
  • 1.1k

rdlc reporting problem in winforms

Feb 15 2014 1:26 AM
I got the report using rdlc by the report wizard but i can't view anything by using this methode

programmatically..

Here I just added a report file report2.rdlc and a report viewer reportViewer2 to the form. and no more process

done with out the following code in a button click


My code in button click event
'''''''''''''''''''''''''''''

String get_results = "SELECT * FROM Employee";

SqlConnection con = new SqlConnection(@"Connection String");
con.Open();
SqlDataAdapter adp = new SqlDataAdapter(get_results, con);

DataSet ds = new DataSet();

adp.Fill(ds);



Microsoft.Reporting.WinForms.ReportDataSource repds = new Microsoft.Reporting.WinForms.ReportDataSource

("Employee",ds.Tables[0]);

reportViewer2.ProcessingMode = ProcessingMode.Local;

String rPath = @"F:\report\report2.rdlc";

reportViewer2.LocalReport.ReportPath = rPath;

reportViewer2.LocalReport.DataSources.Clear();

reportViewer2.LocalReport.DataSources.Add(repds);

reportViewer2.Visible = true;

reportViewer2.RefreshReport();


... i don't get any result on my form... if it need to assign something to the rdlc file or reportviwer other

than the above code, or should i insert a dataset or anything other than the code.. if it need please help me it

in programmatically....