python 水晶报表_水晶报表中的自定义日期格式(custom date formatting in crystal report)...

水晶报表中的自定义日期格式(custom date formatting in crystal report)

我正在研究crysstal报告,我需要按以下格式格式化日期。

格式= D16C30HO在上面的格式字段中

D =前缀硬编码值

16 =系统日期的年份值

C =系统日期值,如A = 1。 1月,B = 2。 二月,C = 3。 三月......

30 =系统日期的日期值

HO =硬代码值。

我是水晶报道的初学者。 是否可以选择格式化水晶报告为此目的提供给我们?

I am working on crysstal report and I need to format the date in the following format.

Format= D16C30HO in above format fields are

D=prefix Hard code value

16=year value of systems date

C=Month value of systems date like A=1. January, B=2. February, C=3. March ....

30=day value of system's Date

HO=hard code value.

I am a beginner for crystal report. is there any option to format that crystal report provide us for such purposes ?

原文:https://stackoverflow.com/questions/36547595

更新时间:2020-02-14 16:50

最满意答案

local datevar A := currentdate;

"D" &

totext(A,"yy") &

chr(65+asc(totext(A,"M"))-49) &

totext(A,"0M") &

"HO"

local datevar A := currentdate;

"D" &

totext(A,"yy") &

chr(65+asc(totext(A,"M"))-49) &

totext(A,"0M") &

"HO"

2016-04-11

相关问答

请尝试: IF {TBM_Report_qry.DiF}<={TBM_Report_qry.tbm} then RGB(234,234,234)

else

(

IF {TBM_Report_qry.inproduction_DiF}<={TBM_Report_qry.Reqired}

then RGB(234,234,234)

else

(

IF {TBM_Report_qry.DiF_Close}<={TBM_Report_qry.clse_Di

...

按Name创建一个组并在组页脚中放置Name field 。 然后创建2个运行总计,一个用于DATE_CREATE ,另一个用于DATE_COMPLETE 。 在运行总计屏幕上,您将放置所谓的摘要类型 - > count ,评估使用公式 - > DATE_CREATE =您的参数(您要评估的日期)与DATE_COMPLETE相同并重置 - >更改组并选择您的组按Name 。 将此2个运行总计也放在您的组页脚上并禁止显示详细信息部分 create a group by Name and place

...

最好的方法是从后面的代码中提供空间。 直到今天,标题格式问题出现在我的水晶报告版本中。 所以我必须做这样的事情。 The Best way can be to give space already from the code behind. As till today, the header formatting issue is there in my crystal Report version. So I have to do something like this.

使用这个功能...... Public Function ReportDateFilter(Date1 As Date, Date2 As Date, DataField As String) As String

Dim A1 As String

Dim b1 As String

Dim c1 As String

Dim d1 As String

Dim E1 As String

Dim f1 As String

A1 = Format(Date1, "yyyy") & ","

b1 = For

...

您可以将列的类型更改为Date如下所示: ALTER TABLE YOURTable ALTER COLUMN YOURCOLUMN DATE;

那么你不需要转换它。 或者你可以在水晶报告中使用日期值函数,例如: DateValue({myTable.strDate})

You can change the type of your column to Date as folow : ALTER TABLE YOURTable ALTER COLUMN YOURCOLUMN DATE;

...

两种解决方案 调整对象的大小以完整地覆盖details部分 将逻辑从details部分移动到每个对象的背景属性的条件公式 我会推荐第一个选项。 Two solutions: resize your objects to cover the details section in its entirety move the logic from the details section to the conditional-formula for each object's background pro

...

在报表上放置一个文本对象 (带有'ab'的文本对象作为符号)。 在文本对象中键入一组括号,然后将{YourField}拖放到其中。 这将使用括号显示值。 要格式化文本对象中的数字字段,请右键单击它并选择格式{YourField} 。 将Rounding设置为0.1,将Decimal设置为1.0以满足您的需求。 或者在格式编辑器中添加显示字符串- >常用 '( '+ ToText(Round({YourField},1),"0.0") + ' )'

Place a Text Object (the

...

local datevar A := currentdate;

"D" &

totext(A,"yy") &

chr(65+asc(totext(A,"M"))-49) &

totext(A,"0M") &

"HO"

local datevar A := currentdate;

"D" &

totext(A,"yy") &

chr(65+asc(totext(A,"M"))-49) &

totext(A,"0M") &

"HO"

右键单击日期字段,然后单击格式化,如果日期格式未到来,则表示数据库中的数据未存储为日期,而是存储为nvarchar或任何其他格式,如果是这种情况,则首先需要转换此字段到目前为止,并在此处显示,右键单击它可以设置您喜欢的日期格式。 如果您需要帮助,请告诉我。 谢谢。 Right Click the date field, and click Format, if formats of the date are not coming it means your data in database is

...

尝试删除CDate功能我想它也会起作用。 你的最终成果看起来像: DateAdd ("m",ToNumber({TableName.interval}),{TableName.date} )

Try to remove the CDate function I guess it will also work. Your final fomrula must look like: DateAdd ("m",ToNumber({TableName.interval}),{TableName.date

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值