c# - How to show parameters which were passed into the query, on the report -
in .net winforms application i'm using reportviewer
. create dataset
, configure dataadapter
, use dataset
in report.rdlc design report. bind report report viewer.
this query behind report
select reference month, payment_date date, sum(total_records) records, sum(total_amount) amount, round(sum(total_amount) / sum(total_records), 2) average payment group reference, payment_date having (payment_date between @fromdate , @todate)
then pass parameters adapter , show report follows...
private void btnshowreport_click(object sender, eventargs e) { this.paymenttableadapter.fill(this.datasetwagespaymentsummary.payment,dtpfrom.value.tostring(),dtpto.value.tostring()); this.rpwagessummary.refreshreport(); }
[dtpfrom , dtpto datetimepickers]
now i'm trying want show these @todate
, @fromdate
parameters in report this...
payment summary report 1/1/2014 31/1/2014
you need create parameter in report:
- report data - parameters
- right click - add new parameter, example todate.
next, need pass parameter report.
reportparameter rp1 = new reportparameter("todate", dtpfrom.value.tostring()); this.reportviewer1.localreport.setparameters(new reportparameter[] { rp1 });
then add textbox in report , set expression.
for example:
=parameters!todate.value
Comments
Post a Comment