error in Micosoft Report Viewer.. please help
-
Friday, January 23, 2009 11:43 AM
I am new to Microsoft Report Viewer and trying to a use for the first time. I have just created a blank report in Visual Studio and added a textbox with the valie:
=Fields!vehicle_chassis_number.Value
In Visual Studio, hee is my Code:
data_set =
new DataSet();reportViewer1.ProcessingMode =
ProcessingMode.Local; LocalReport rep = reportViewer1.LocalReport;rep.ReportPath =
@"C:\Users\Jassim\Documents\Visual Studio 2008\Projects\Taajeer\Taajeer\Report1.rdlc";sql_connection =
new SqlConnection("Data Source=.\\SQLEXPRESS;initial catalog=rent_a_car_company;integrated security=true");sql_connection.Open();
sql_command =
new SqlCommand("sp_get_agreement_by_id", sql_connection);sql_command.CommandType =
CommandType.StoredProcedure;sql_command.Parameters.Add(
"@vehicle_id", SqlDbType.Int).Value = 1;sql_adapter =
new SqlDataAdapter(sql_command);sql_adapter.Fill(data_set);
sql_adapter.Dispose();
// sql_connection.Close(); ReportDataSource dsReport = new ReportDataSource();dsReport.Name =
"Invoice_sprocInvoiceView";dsReport.Value = data_set.Tables[
"Invoice"];rep.DataSources.Add(dsReport);
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(dsReport);
reportViewer1.RefreshReport();
rep.Refresh();
this.reportViewer1.RefreshReport();but I am getting this error message:
Error 1 The Value expression for the textbox ‘textbox3’ refers to the field ‘vehicle_chassis_number’. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope. C:\Users\Jassim\Documents\Visual Studio 2008\Projects\Taajeer\Taajeer\Report1.rdlc Taajeer
Jassim Rahma
All Replies
-
Friday, January 23, 2009 4:45 PM
Hi Jassim, this forum is for software developers who are using the Open Protocol Specification documentation to assist them in developing systems, services, and applications. The Open Protocol Specifications can be found at: http://msdn2.microsoft.com/en-us/library/cc203350.aspx. Since your post does not appear to be related to the Open Protocol Specification documentation set we would appreciate it if you could try the 'Visual Studio Report Controls' forum at http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/threads/ instead to find the information you are looking for. Thanks!
Regards,
Bill Wesse - MSFT
Escalation Engineer- Marked As Answer by Bill Wesse MSFT Friday, January 23, 2009 4:45 PM
- Edited by Alex MorrillMicrosoft Employee, Owner Tuesday, January 27, 2009 11:39 PM removed Windows reference - forum is for more general interoperability