|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Sunday, October 21, 2012 9:24 PM
Points: 65,
Visits: 279
|
|
Hi Asif, I chaged my database name exactly same and it is showing the error again. any idea, Bis
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, November 12, 2008 10:44 AM
Points: 376,
Visits: 3
|
|
I have tried numerous times to resolve the error I am getting with this and put up my watch window and it says my reader object drReport is throwing an exception but the application runs and displays the report viewer with the message "The source of the report definition has not been specified. I am forwarding my code...any help appreciated. private void Form1_Load(object sender, EventArgs e){ //use following if you use standard securitystring cnString = @"Data Source= sparrishlpt2\stacy;Initial Catalog=northwind; Integrated Security=SSPI";//declare Connection, command and other related objectsSqlConnection conReport = new SqlConnection(cnString);SqlCommand cmdReport = new SqlCommand();SqlDataReader drReport;DataSet dsReport = new dsProduct();try{ //open connectionconReport.Open(); //prepare connection object to get the data through reader and populate into datasetcmdReport.CommandType = CommandType.Text;cmdReport.Connection = conReport; cmdReport.CommandText = "Select TOP 5 * FROM Products Order By ProductName";//read data from command objectdrReport = cmdReport.ExecuteReader(); //new cool thing with ADO.NET... load data directly from reader to datasetdsReport.Tables[0].Load(drReport); //close reader and connectiondrReport.Close(); conReport.Close(); //provide local report information to viewerreportViewer1.LocalReport.ReportEmbeddedResource = "rsWin1.rptProductList.rdlc";//prepare report data sourceReportDataSource rds = new ReportDataSource();rds.Name = "dsProduct_dtProductList"; rds.Value = dsReport.Tables[0]; reportViewer1.LocalReport.DataSources.Add(rds); //load report viewerreportViewer1.RefreshReport(); } catch (Exception ex){ //display generic error message back to userMessageBox.Show(ex.Message);} finally{ //check if connection is still open then attempt to close itif (conReport.State == ConnectionState.Open){ conReport.Close(); } }
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, February 14, 2008 2:21 PM
Points: 18,
Visits: 3
|
|
Hi Stacy, Please make sure you have the correct project name specified, I hope it is "rsWin1"? reportViewer1.LocalReport.ReportEmbeddedResource = "rsWin1.rptProductList.rdlc"; If you wish, you can zip the entire project and email it to me at: asif.blog at gmail dot com. Regards, Asif
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, November 12, 2008 10:44 AM
Points: 376,
Visits: 3
|
|
Asif, your email you reference is Asif.blog@gmail.com, correct? I zipped the project and I am getting failure from the postmaster My project name is rswin1, any other thoughts? Stacy
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, February 14, 2008 2:21 PM
Points: 18,
Visits: 3
|
|
Thats strange! I am getting email regularly on gmail account, never got any complaint. If you are sending through Gmail then make sure to change the file extension from .ZIP to anything else as Gmail will not let you attache ZIP file, which has any executables in side. Or try sending me at asif_to@yahoo.com Regards, Asif
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, February 14, 2008 2:21 PM
Points: 18,
Visits: 3
|
|
Stacy, Please make sure the reportviewer1.ProcessingMode = Local This should resolve the issue. Regards, Asif
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: 2 days ago @ 2:31 PM
Points: 359,
Visits: 94
|
|
i found them finally they are under "Report" menu and not on right click !
|
|
|
|