如何在 Reporting Services 分组中引用 VB 函数

发布于 2024-08-08 00:47:09 字数 903 浏览 2 评论 0原文

早上好,

我正在使用 Reporting Services 2005 生成一份一次性报告,该报告将根据 PLANCODE 字段对记录进行分组。我创建了以下 VB 函数:

Function PayorGroup (ByVal ipc as String) as String
set ipc = PLANCODE
Select Case ipc
Case 'M01' to 'M99'
PayorGroup = "Medicare"
Case 'A01' to 'A99'
PayorGroup = "Medicare"
Case 'C01' to 'C99'
PayorGroup = "Cash Pay"
Case 'T01' to 'T99' 
PayorGroup = "TCMS"
Case 'W01' to 'W99'
PayorGroup = "Work Comp"
Case 'Y01' to 'Y99'
PayorGroup = "Medi-Cal Managed Care"
Case 'Z01' to 'Z99'
PayorGroup = "Medi-Cal"
Case Else
PayorGroup = "Managed Care/Other"
End Select
Return PayorGroup
End Function

我的目的是让上述函数评估 PLANCODE 字段并返回适当的 PayorGroup,该 PayorGroup 将用于对我的报告中的数据进行分组。我已将上述函数放置在报告属性代码窗口中。

如何在新的计算字段中引用上述函数,以便报表根据该函数的结果对数据进行分组?文档指出表达式应该类似于 =code.PayorGroup。但是,当我在“计算字段”窗口中尝试此表达式时,我看到臭名昭著的红色波浪线,指出“无法识别的 Idnetifier”。

有人可以为我提供一些关于此解决方案的最佳路线的指导吗?

谢谢, 席德

Good Morning,

I'm using Reporting Services 2005 to produce a one-time report that will group records according to the PLANCODE field. I've created the following VB function:

Function PayorGroup (ByVal ipc as String) as String
set ipc = PLANCODE
Select Case ipc
Case 'M01' to 'M99'
PayorGroup = "Medicare"
Case 'A01' to 'A99'
PayorGroup = "Medicare"
Case 'C01' to 'C99'
PayorGroup = "Cash Pay"
Case 'T01' to 'T99' 
PayorGroup = "TCMS"
Case 'W01' to 'W99'
PayorGroup = "Work Comp"
Case 'Y01' to 'Y99'
PayorGroup = "Medi-Cal Managed Care"
Case 'Z01' to 'Z99'
PayorGroup = "Medi-Cal"
Case Else
PayorGroup = "Managed Care/Other"
End Select
Return PayorGroup
End Function

My intent is to have the above function evaluate the PLANCODE field and return the appropriate PayorGroup which will be used to group data in my report. I've placed the above function in my Report Properties Code Window.

How do I reference the above function in a new calculated field so that the report will group data based on the results of this function? The doucmentation states that the expression should be something like =code.PayorGroup. However, when I try this expression in the Calculated Field window, I get the infamous red squiggly line stating Unrecognized Idnetifier.

Can someone provide me some direction as to what the best route would be for this solution?

Thanks,
Sid

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

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

发布评论

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

评论(1

三生一梦 2024-08-15 00:47:09

我建议在 SQL 中为此创建一个查找表 &将其与您拥有的基表/查询连接起来。

它有几个优点

  1. 逻辑不会被冻结在内部
    报告。
  2. 任何附加值都可以
    使用查找来处理
    桌子。

I would suggest creating a lookup table in SQL for this & join it with the base table/query that you have.

It has several advantages

  1. The logic won't be frozen inside the
    report.
  2. Any additional value can be
    taken care of using the lookup
    table.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文