如何更改 Cognos 报表文本框中的顶部值名称?

发布于 2024-07-08 08:33:10 字数 58 浏览 5 评论 0原文

下拉列表中第一项的默认值是数据库字段的名称。 我需要将其更改为更用户友好的名称。 我如何更改该值?

The default value for the first item in a drop down list is the name of the database field. I need to change it to a more user friendly name. How do I change the value?

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

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

发布评论

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

评论(4

つ可否回来 2024-07-15 08:33:10

将 HTML 项目添加到提示页面上,并将以下内容添加为 HTML 项目:

示例:
<脚本>
document.formWarpRequest._oLstChoicesMyList[0].text = '--选择城市--';

将“MyList”替换为组件的名称。

来自:链接文本

add a HTML Item onto the prompt page and add the following as an HTML item:

Example:
<script>
document.formWarpRequest._oLstChoicesMyList[0].text = '--SELECT A CITY--';
</script>

Replace 'MyList' with the name of the component.

from: link text

玩世 2024-07-15 08:33:10

在 Cognos 10 中,您可以在 Report Studio 中指定您选择的提示文本。

  1. 选择值提示
  2. 在“属性”窗格中的“提示文本”部分下,“标题文本”属性将设置为“自动”。 单击旁边的省略号按钮,将打开标题文本对话框。
  3. 选择“指定文本”选项。 单击省略号。
  4. 提供您选择的文本,然后单击“确定”。
  5. 运行报告,您将看到您提供的文本将显示为下拉列表中的第一项。

为了更好地理解,我提供了屏幕截图。

如何更改提示标题文本

In Cognos 10, you can specify prompt text of your choice in Report Studio.

  1. Select the value prompt
  2. In Properties pane, under 'Prompt Text' section, the 'Header Text' property will be set to Automatic. Click the ellipsis button next to it and Header Text Dialogue opens.
  3. Select 'Specified Text' choice. Click ellipsis.
  4. Provide the text of your choice and click ok.
  5. Run the report and you will see text that you provided will appear as first item in the drop down list.

I have provided a Screen shot for a better understanding.

How to change prompt header text

若相惜即相离 2024-07-15 08:33:10

你有几个选择。 首先,您可以将数据项的名称从数据库字段名称重命名为 Framework Manager 元数据中更友好的名称。

其次,您可以在 Report Studio 中重命名该项目。 但是,如果您这样做,您会注意到它仍在使用数据库名称。 您实际上需要在项目表达式中执行计算才能使用您的名称而不是默认名称。 假设您正在拉入字符串字段 [命名空间].[不友好名称],并将报告数据项命名为“友好名称”。 顶部的选择仍将显示“不友好的名称”。 但是,如果将数据项替换为以下内容:

[命名空间].[不友好的名称] || ”

它将看到涉及计算并使用您的友好名称。 对于数字字段,您必须添加零而不是连接“”。

报告列标题也是如此(您可以将其替换为文本,而不是使用此计算方法)。

复杂吗? 是的。

You have a couple of options. First, you can rename the data item's name from database field name to a more friendly name in the Framework Manager metadata.

Second, you can rename the item in Report Studio. However, if you do this you will notice that it is still using the database name. You actually need to perform a calculation in the item expression for it to use your name instead of the default name. So say you are pulling in the string field [Namespace].[Unfriendly Name] and you named your report data item "Friendly Name." The top selection will still read "Unfriendly Name." However, if you replace the data item with the following:

[Namespace].[Unfriendly Name] || ''

It will see that there is a calculation involved and use your friendly name. In the case of a number field you have to add zero instead of concatenating ''.

This is also the case with report column headers (which you can replace with text instead of using this calculation method).

Convoluted? Yes.

想你的星星会说话 2024-07-15 08:33:10

在查询中的数据项中..您可以执行 ..

IF ( [dataitemA] = 'some text' ) THEN
('新文本')
别的
( [dataitemA] )

我尽量避免使用 javascript 和 html 项目,因为它们通常不适用于 pdf 或 excel 输出。

只是一个想法..

干杯!

Within the dataitem in the query.. you could do a ..

IF ( [dataitemA] = 'some text' ) THEN
( 'new text' )
ELSE
( [dataitemA] )

i try to avoid using javascript and html items becuase they dont generally work in pdf or excel outputs.

just a thought..

cheers!

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