I have two parameters dateFrom
and dateTo
which I want to filter my report based on those values and show sum of total
column of filtered
You should apply the filter on the data source of your report, for example:
invoice_viewTableAdapter.Fill(this.db_posDataSetInvoice.invoice_view);
this.invoice_viewBindingSource.Filter = "Put your filter here";
reportViewer1.RefreshReport();
Supposing you have a MyDateField
field and you have dateFrom and dateTo of type of DateTime
.
This can be your date filter:
String.Format("MyDateField>= #{0:yyyy/MM/dd}# AND MyDateField<= #{1:yyyy/MM/dd}#"
, dateFrom, dateTo);
you can find more information about about BindingSource.Filter
expression syntax here.