如何在 Cognos 报告中构建 Mailto 超链接列?

发布于 2024-10-20 08:20:17 字数 2062 浏览 2 评论 0原文

我正在构建一份报告,其中显示由于未满足培训截止日期而不合规的用户列表。

显示和过滤数据的查询已构建,并且我已验证列表中显示了正确的信息。

我现在想向网格添加一些“操作项”。我正在处理的第一个项目是“超链接按钮”,它将向不合规的用户发送一封电子邮件。该电子邮件应发送给该用户,具有硬编码主题,并包含具有硬编码文本和查询中的一些数据点的正文。

按钮列的“列表列主体”的“源类型”属性设置为“报告表达式”

表达式:

'mailto:'+ [ExceptionsByOrgQuery].[Email]  + '?subject=Compliance%20Exception&body=Hello%20' + [ExceptionsByOrgQuery].[Full Name - First Last] + '%2C%0D%0A%0D%0AYou%20are%20overdue%20for%20training.%20%20Please%20complete%20the%20following%20training%20as%20soon%20as%20possible.%0D%0ATraining%20course%3A%20' + [ExceptionsByOrgQuery].[Activity Name] + '%0D%0ADue%20Date%3A%20' + [ExceptionsByOrgQuery].[Date]

用于构建链接的所有变量都在查询中,并且应与该行的项目匹配, 正确的?

由于某种原因,我在尝试验证此报告时收到错误。

我收到的错误是:

RSV-VAL-0032 The following expression is not valid:...expression here... If the item exists in a query but is not referenced in the layout, add it to a property list. CRX-API-0005 An error ocurred at or near the position '11'. The variable named 'ExceptionsByOrgQuery].[Email]' is invalid.

我更不确定错误的第一部分意味着什么。 email 变量未显示在网格中,但它是查询的一部分。我可以将其添加到网格中并验证它是否在查询中,但我不希望该值显示在报告中(我也不希望显示变量 [全名 - 名字 - 姓氏];这只是为了电子邮件中的问候语)。

附加信息: 该列表是通过名为 [ReportQuery] 的查询填充的 它包含以下数据项。

  • [姓名] <- [合规性].[员工].[姓氏] + ', ' +[合规性].[员工].[名字]
  • [组织] <- set([维度视图].[组织].[组织] -> ?org?)
  • [注册状态] <- [合规].[因例外而发生的组织].[注册状态]
  • [职务] <- [合规].[员工].[职务]
  • [活动名称] <- [合规性].[活动].[活动名称]
  • [截止日期] <- [合规性].[时间].[Date_US]
  • [电子邮件] <- [合规性].[员工].[电子邮件]
  • [姓名 - 名字 - 姓氏] <- [合规性].[员工].[名字] + ' ' +[合规性].[员工].[姓氏]

(第一项是标签,第二部分是用于制作数据项的表达式)

编辑1(来自近战的建议): 我已尝试您描述的方法,但现在看到此错误:RSV-VAL-0032 以下表达式无效:''。如果该项目存在于查询中但未在布局中引用,请将其添加到属性列表中。 CRX-API-0005 在位置“21”处或附近发生错误。名为“[ReportQuery].[Email]”的变量无效。

我对此错误进行了查询,发现 List 对象需要在“Properties”属性中具有我在 mailto 中使用的属性。定义此属性允许我从查询中选择项目。我用 mailto 做到了这一点,但它似乎没有将值与正确的行相匹配; IE。我已将 mailto 上的主题参数设置为用户名 ([ReportQuery].[Name]),但它与表中行中显示的内容不匹配。

I am building a report which shows a list of users that are out of compliance due to not meeting a training deadline.

The queries that show and filter the data have been built and I have verified the correct information is showing in my list.

I now want to add some "action items" to the grid. The first item I am working on is a "Hyperlink Button" that will launch an email to the out-of-compliance user. The email should be addressed to this user, have a hard coded subject, and contain a body that has hard coded text with some data points from the query.

The "List Column Body" for the button column has its "Source Type" property set to "Report Expression"

Expression:

'mailto:'+ [ExceptionsByOrgQuery].[Email]  + '?subject=Compliance%20Exception&body=Hello%20' + [ExceptionsByOrgQuery].[Full Name - First Last] + '%2C%0D%0A%0D%0AYou%20are%20overdue%20for%20training.%20%20Please%20complete%20the%20following%20training%20as%20soon%20as%20possible.%0D%0ATraining%20course%3A%20' + [ExceptionsByOrgQuery].[Activity Name] + '%0D%0ADue%20Date%3A%20' + [ExceptionsByOrgQuery].[Date]

All the variables that are used to build the link are in the query and should be matching up to the items for that row, correct?

For some reason I am getting an error when trying to validate this report.

The error I receive is:

RSV-VAL-0032 The following expression is not valid:...expression here... If the item exists in a query but is not referenced in the layout, add it to a property list. CRX-API-0005 An error ocurred at or near the position '11'. The variable named 'ExceptionsByOrgQuery].[Email]' is invalid.

I'm more unsure what the first part of the error means. The email variable is not shown in the grid, but it is part of the query. I can add it to the grid and verify that it is in the query, but I do not want that value to display in the report (nor do I want the variable [Full Name - First Last] to be displayed; it's just for the greeting in the email).

ADDITIONAL INFORMATION:
The List is populating from a query called [ReportQuery]
It contains the following data items.

  • [Name] <- [Compliance].[Employee].[Last Name] + ', ' +[Compliance].[Employee].[First Name]
  • [Organization] <- set([Dimensional View].[Organization].[Organizations] -> ?org?)
  • [Registration Status] <- [Compliance].[Fact Organization Due Exception].[Registration Status]
  • [Title] <- [Compliance].[Employee].[Title]
  • [Activity Name] <- [Compliance].[Activity].[Activity Name]
  • [Due Date] <- [Compliance].[Time].[Date_US]
  • [Email] <- [Compliance].[Employee].[Email]
  • [Name - First Last] <- [Compliance].[Employee].[First Name] + ' ' +[Compliance].[Employee].[Last Name]

(the first item is the label and the second portion is expression that is used to make the data item)

EDIT 1 (from melee's suggestions):
I've attempted the method you describe, but am now seeing this error: RSV-VAL-0032 The following expression is not valid: ''. If the item exists in a query but is not referenced in the layout, add it to a property list. CRX-API-0005 An error ocurred at or near the position '21'. The variable named '[ReportQuery].[Email]' is invalid.

I did a query regarding this error and saw that that the List object needed to have the properties that I used in the mailto in a "Properties" property. Defining this property allowed me to select items from the query. I did this with mailto, but it appears to be not matching up values to the correct row; ie. I've set the subject argument on the mailto to be the user's name ([ReportQuery].[Name]) and it doesn't match up with what is shown on the row in the table.

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

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

发布评论

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

评论(1

回首观望 2024-10-27 08:20:17

好的,所以您需要按照以下步骤使其正常工作 - 您的语法、串联和其他一切看起来都很棒 - 只需对过程进行一些调整,您就可以开始了。

  1. 将 HTML 项目拖到列表报告中。
  2. 选择它 - 在属性窗格下,将“源类型”更改为“报告表达式”(默认为文本,目前对我们来说没有用)
  3. 双击 HTML 项目并创建 mailto 锚点您可以使用您的代码示例,但在关闭之前请确保其验证正确。最简单的来说,它应该类似于: '' - 重要;此时不要关闭锚标记。
  4. 解锁报告(顶部的挂锁)
  5. 将另一个 HTML 项目添加到单元格(它看起来像同一列中有两个 HTML 项目)并将其设置为“报告表达式”
  6. 双击 HTML 项目并添加静态文本/关闭标签。例如: 给我发电子邮件

运行报告,您应该有可以单击的链接(经测试在 8.4.1 上有效)

Ok, so you're going to need to follow these steps to get this to work properly - your syntax, concatenation, and everything else looks great - just a little tweaking of the process and you'll be good to go.

  1. Drag an HTML item into a list report.
  2. Select it - under the properties pane, change "Source Type" to "Report Expression" (defaults to Text, which is of no use to us right now)
  3. Double click the HTML item and create the mailto anchor You can use your code sample, but make sure it is validating correctly before closing. it should, at its simplest, look something like: '<a href="mailto' + [Data Item] + '">' - important; do not close the anchor tag at this point.
  4. Unlock the report (padlock on the top)
  5. Add another HTML item to the cell (it will look like there's two HTML items in the same column) and set it to "Report Expression"
  6. Double click the HTML item and add static text/close the tag. For example: Email Me</a>

Run the report and you should have links that you can click (tested as working on 8.4.1)

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