Report Viewer .rdlc如何传递参数?

时间:2022-01-30 15:52:50

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.

显然,我一直在C#窗口表格中进行试算平衡报告 - 报告查看器显示“帐户”的年度报告及其在每个帐户中的应付总额。

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".

该报告假设每年的复合值取决于用户的选择 - 例如。 2013年1月1日至2月。 2014年1月至2013年1月至12月,“TOTAL = 4,500,000”和2014年1月至2月,“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".

2013年1月至12月,“TOTAL = 4,500,000”和2014年1月至2月,“TOTAL = 4,545,000”。

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

我在单元格中的代码是= RunningValue(Fields!DEBIT.Value,Sum,“summaryDataSet”)。

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

我希望读者能理解我在这里要说的话并帮助我。谢谢。

1 个解决方案

#1


12  

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将参数传递给你的报告:

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...

我不明白你在问题文本中试图告诉我们什么,它似乎根本不适合这个问题......

#1


12  

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将参数传递给你的报告:

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...

我不明白你在问题文本中试图告诉我们什么,它似乎根本不适合这个问题......