B
BadStorm
Hi,
I have an application that on runtime generate a datatable with a list of
persone, with name, andress, etc..
I want to add the posbility to print the list of all the person, and I want
to use ReportViewer. But I have this problem:
I create with the designer my report, without set and datasource. Then from
code:
SqlDataAdapter Read = new SqlDataAdapter("SELECT * FROM People",
Connection);
DataTable PeopleTable = new DataTable();
Read.Fill(PeopleTable);
reportViewer1.LocalReport.DataSources.Add(new
Microsoft.Reporting.WinForms.ReportDataSource("People", PeopleTable));
reportViewer1.LocalReport.ReportEmbeddedResource =
"MyReports.Report1.rdlc";
But when I test my program I get this error:
The Value expression for the textbox 'textbox1' refers to
the field 'Name'. Report item expressions can only refer to fields within
the current data set scope or, if inside an aggregate, the specified
data set scope.
My question is: It is possible to use a Report.rdcl create with the
designer, with a runtime dataset?
In a textbox of the Report.rdcl wath value is to set? Now I used
=Fields!Name.Value
Thanks
Marco
I have an application that on runtime generate a datatable with a list of
persone, with name, andress, etc..
I want to add the posbility to print the list of all the person, and I want
to use ReportViewer. But I have this problem:
I create with the designer my report, without set and datasource. Then from
code:
SqlDataAdapter Read = new SqlDataAdapter("SELECT * FROM People",
Connection);
DataTable PeopleTable = new DataTable();
Read.Fill(PeopleTable);
reportViewer1.LocalReport.DataSources.Add(new
Microsoft.Reporting.WinForms.ReportDataSource("People", PeopleTable));
reportViewer1.LocalReport.ReportEmbeddedResource =
"MyReports.Report1.rdlc";
But when I test my program I get this error:
The Value expression for the textbox 'textbox1' refers to
the field 'Name'. Report item expressions can only refer to fields within
the current data set scope or, if inside an aggregate, the specified
data set scope.
My question is: It is possible to use a Report.rdcl create with the
designer, with a runtime dataset?
In a textbox of the Report.rdcl wath value is to set? Now I used
=Fields!Name.Value
Thanks
Marco