如何更改 Oracle BI Publisher 中的日期格式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28711911/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:45:02  来源:igfitidea点击:

How to change the date format in Oracle BI Publisher?

oracleoracle11gbusiness-intelligenceobieebi-publisher

提问by MontyPython

How do I change the format of the date while creating a report using data model which I created using a simple SQL query which fetches aggregated data from a data warehouse? I need the date in a simple dd-mon-yy format. I am not able to locate where the format option exists in BI Publisher. The BI Component I am using is PivotTable.

如何在使用数据模型创建报告时更改日期格式,该数据模型是使用从数据仓库获取聚合数据的简单 SQL 查询创建的?我需要一个简单的 dd-mon-yy 格式的日期。我无法在 BI Publisher 中找到格式选项的位置。我使用的 BI 组件是数据透视表。

enter image description here

在此处输入图片说明

The problem with order:

订单问题:

Although, I have ordered my data in the data model, still the data is not showing up in the proper order in the chart. The same thing is working fine on the data table. See below -

虽然,我已经在数据模型中对我的数据进行了排序,但数据仍然没有以正确的顺序显示在图表中。同样的事情在数据表上工作正常。见下文 -

enter image description here

在此处输入图片说明

采纳答案by Lalit Kumar B

I need the date in a simple dd-mon-yy format.

我需要一个简单的 dd-mon-yy 格式的日期。

Did you use the proper format model in your query?

您是否在查询中使用了正确的格式模型?

For example,

例如,

If the date value in the database is 20150225, then you need to first convert it to date using TO_DATEand respective FORMAT MODEL.

如果数据库中的日期值为20150225,则需要首先使用TO_DATE和相应的FORMAT MODEL将其转换为日期。

to_date('20150225','YYYYMMDD')

to_date('20150225','YYYYMMDD')

In order to display the date in your desired format, just use TO_CHARand desired format model:

为了以您想要的格式显示日期,只需使用TO_CHAR和所需的格式模型:

to_char(to_date('20150225','YYYYMMDD'),'DD-MON-YYYY')

to_char(to_date('20150225','YYYYMMDD'),'DD-MON-YYYY')

Have a look at this article.

看看这篇文章

UpdateRegarding alphabetical sorting on month in chart

更新关于图表中月份的字母排序

Found the following information on web:

网上找到了以下信息:

If you are designing chart using RTF template, please try this:

如果您正在使用RTF 模板设计图表,请尝试以下操作:

  1. Right click chart image - click size - click AltText tab
  2. Copy the chart code into a notepad
  3. Look for the tag ColLabelsIt will be something like this:
  1. 右键单击图表图像 - 单击大小 - 单击 AltText 选项卡
  2. 将图表代码复制到记事本中
  3. 寻找标签 ColLabelsIt 将是这样的:

ColLabelsxsl:for-each select=".//G_1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xsl:sort order="ascending" select="FIRST_NAME"/Labelxsl:value-of select="FIRST_NAME" //Label/xsl:for-each/ColLabels

ColLabelsxsl:for-each select=".//G_1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xsl:sort order="ascending" select="FIRST_NAME"/Labelxsl: value-of select="FIRST_NAME" //Label/xsl:for-each/ColLabels

Please see the sorting order that has been highlighted. In sorting order, you can add the field/column that is holding the month/year combination. If your chart is using group function then xsl:sort order="ascending" select="current-group()/FIRST_NAME"/

请查看突出显示的排序顺序。按排序顺序,您可以添加保存月/年组合的字段/列。如果您的图表正在使用分组功能,那么xsl:sort order="ascending" select="current-group()/FIRST_NAME"/

回答by tetito007

  1. Select the column ( type : date)
  2. Click on properties (left Bar)
  3. Change: formating Style (Oracle) and formating Mask ( DD/MM/YYYYY)
  1. 选择列(类型:日期)
  2. 单击属性(左栏)
  3. 更改:格式化样式(Oracle)和格式化掩码(DD/MM/YYYYY)

enter image description here

在此处输入图片说明

回答by user2198624

It is very simple. Follow the navigation.

这很简单。按照导航。

Double click the field-> Select Type as Date and Date Format as dd-MMM-yyyy. This should resolve your issue

双击字段-> 选择类型为日期和日期格式为 dd-MMM-yyyy。这应该可以解决您的问题

I wanted to post a image, but no reputation.

我想张贴图片,但没有声誉。

How this helps..

这有什么帮助..