Visual Studio 2008报表设计器(复杂总账)

发布于 2024-11-30 05:25:02 字数 717 浏览 1 评论 0原文

我正在合并报告以创建一个总账报告,目前它由 84 个单独的报告组成。我的想法是最终用户将有一个部门和月份的下拉列表。这些是我的专栏:

帐号 帐户描述 当前期间 实际

年初至今 实际年初至今预算 年初至今预算差异

总年度预算 帐户状态

我已经弄清楚了大部分内容,但无法理解如何计算年初至今实际和年初至今预算,因为这些需要多个字段的总和取决于选择的月份和部门。

我的 where 语句是这样的,并处理当前期间的实际值和帐号

: ( gl_master.acct_cde = gl_master_comp_v.acct_cde ) 和
( gl_master.budget_officer =budget_off_mstr.budget_officer ) 和
( ( gl_master_comp_v.acct_comp1 = '01' ) 和
(budget_off_mstr.budget_officer IN (@BudgetOfficer))) 和 ((@Month = 1 AND gl_master.post_bal_mon_1) 或 (@Month = 2 AND gl_master.post_bal_mon_2)...

当有多个字段被求和时,如何让查询识别需要放入列中的内容。

感谢您的任何见解。如果您之前做过类似的事情,那么它的一小部分样本将会非常有帮助。

I'm combining reports to create a single general ledger report, currently it consists of 84 seperate reports. My idea is the end user will have a drop down for the department and month. These are my columns:

Account Number Account Description Current Period Actual

YTD Actual YTD Budget YTD Budget Variance

Total YR Budget Account Status

I have most of it figured out, but can't understand how to figure YTD Actual and YTD Budget since these will require a Sum of multiple Fields depending on what month and department is selected.

My where statement goes something like this and takes care of the current period actual and account number:

Where
( gl_master.acct_cde = gl_master_comp_v.acct_cde ) and
( gl_master.budget_officer = budget_off_mstr.budget_officer ) and
( ( gl_master_comp_v.acct_comp1 = '01' ) AND
( budget_off_mstr.budget_officer IN (@BudgetOfficer) ) ) AND
((@Month = 1 AND gl_master.post_bal_mon_1) OR
(@Month = 2 AND gl_master.post_bal_mon_2)...

How can I have the query recognize what needs to be put into the column when there are multiple fields being summed.

Thanks for any insight. If you made something like this before a small sample of it would be very helpful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半寸时光 2024-12-07 05:25:02

我解决了。

它需要在数据集中的计算字段中完成。然后可以对文本框中的字段进行求和。

计算字段的一小块:

=Cdec(Switch(Parameters!Month.Value = 1, Fields!post_bal_mon_1.Value,
Parameters!Month.Value = 2, Fields!post_bal_mon_2.Value + Fields!post_bal_mon_1.Value, 
Parameters!Month.Value = 3, Fields!post_bal_mon_3.Value + Fields!post_bal_mon_1.Value + Fields!
post_bal_mon_2.Value, 
Parameters!Month.Value = 4, Fields!post_bal_mon_4.Value + Fields!post_bal_mon_1.Value + Fields!  
post_bal_mon_2.Value + Fields!post_bal_mon_3.Value,...)) 

总和的文本框(我将其放在页脚中):

=SUM(Fields!post_bal_mon_1.value, "DataSet1")

I worked it out.

It needs to be done in a calculated field within the dataset. Then a sum can be done on the field in the textbox.

small chunk of calculated field:

=Cdec(Switch(Parameters!Month.Value = 1, Fields!post_bal_mon_1.Value,
Parameters!Month.Value = 2, Fields!post_bal_mon_2.Value + Fields!post_bal_mon_1.Value, 
Parameters!Month.Value = 3, Fields!post_bal_mon_3.Value + Fields!post_bal_mon_1.Value + Fields!
post_bal_mon_2.Value, 
Parameters!Month.Value = 4, Fields!post_bal_mon_4.Value + Fields!post_bal_mon_1.Value + Fields!  
post_bal_mon_2.Value + Fields!post_bal_mon_3.Value,...)) 

textbox for sum(I place this in footer):

=SUM(Fields!post_bal_mon_1.value, "DataSet1")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文