Report Viewer .rdlc How to pass a parameter?

耗尽温柔 提交于 2019-12-11 10:31:46

问题


So apparently I been doing a trial balance report in C# windows form - report viewer that shows a YEARLY report of "ACCOUNTS" and its total payable in each account.

The report has a supposed yearly compounding value depending from the user choice - ex. Jan. 1 2013-to-Feb. 1 2014, there will be a compounding value from Jan-Dec 2013, "TOTAL=4,500,000" and Jan-Feb 2014, "TOTAL=45,000".

What I have in the report is a continues compounding value,

Jan-Dec 2013, "TOTAL=4,500,000" and Jan-Feb 2014, "TOTAL=4,545,000".

My code in the cell is =RunningValue(Fields!DEBIT.Value,Sum,"summaryDataSet").

I hope the reader would understand what I'm trying to say here and help me. Thanks.


回答1:


Though I don't know what kept you from using Google to find an answer to the question (by that I mean the question's header only!), you can use ReportParameter to pass parameters to your report:

ReportParameter[] parameters = new ReportParameter[x+1];
parameters[0] = new ReportParameter("name1", value1);
...
parameters[x] = new ReportParameter("namex", valuex);
this.reportViewer1.LocalReport.SetParameters(parameters);

I do not understand what you're trying to tell us by the question text, it does not seem to fit the question at all...



来源:https://stackoverflow.com/questions/21179801/report-viewer-rdlc-how-to-pass-a-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!