如何在 Reporting Services 分组中引用 VB 函数
早上好,
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议在 SQL 中为此创建一个查找表 &将其与您拥有的基表/查询连接起来。
它有几个优点
报告。
使用查找来处理
桌子。
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
report.
taken care of using the lookup
table.