如何更改 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
How to change the date format in Oracle BI 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 组件是数据透视表。
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 -
虽然,我已经在数据模型中对我的数据进行了排序,但数据仍然没有以正确的顺序显示在图表中。同样的事情在数据表上工作正常。见下文 -
采纳答案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 模板设计图表,请尝试以下操作:
- Right click chart image - click size - click AltText tab
- Copy the chart code into a notepad
- Look for the tag ColLabelsIt will be something like this:
- 右键单击图表图像 - 单击大小 - 单击 AltText 选项卡
- 将图表代码复制到记事本中
- 寻找标签 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
回答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..
这有什么帮助..