水晶报表日期问题,请帮忙! [英] Crystal Report date problem,please help !

查看:65
本文介绍了水晶报表日期问题,请帮忙!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!
我真的对Crystal Report感到困扰.我正在尝试使用Crystal Report创建报告.我将Access用作数据库,并且我的数据库中包含以下字段:

字段名称--------------数据类型
ps_entrydate ----------日期/时间
ps_name --------------文字
ps_surename ----------文字
ps_age ----------------数字

当我将数据检索到datagridview时,日期格式为02.02.2011并且可以,但是当我尝试将其打印到Crystal Report中时,日期看起来像这样07.02.2011 00:00:00.我不想要这种格式我想要镜头格式(02.02.2011).
我不知道为什么会这样.在忘记之前,当我将日期/时间更改为文本(ps_entrydate文本)时,看起来不错,但是这次我无法按日期搜索:〜
我尝试了这些方法,但对我来说都不起作用:
toShortDateString();
toString("dd/MM/yyyy");

任何帮助都是最贴切的.请先帮助,谢谢.

hello !
i have really strang problem with Crystal Report. i am trying to create a report using crystal Report. i used Access as database and i have these fields in my database :

field name--------------Data Type
ps_entrydate ---------- Date/Time
ps_name -------------- Text
ps_surename ---------- Text
ps_age ---------------- Number

when i retrieve data into datagridview , date format is in 02.02.2011 and is ok but when i try to print it into Crystal Report , the date looks something like this 07.02.2011 00:00:00. i dont want this format i want shot format (02.02.2011 ).
i have no idea why is happening like this. before forget , when i change the date/Time to Text (ps_entrydate Text) , it looks fine but this time i can not search by date :~
i tried these method, but none of them work to me :
toShortDateString();
toString ("dd/MM/yyyy");

any help is most appriciated . please help , thanks in advance

推荐答案

成员7696839写道:
Member 7696839 wrote:

当我更改时日期/文本时间(ps_entrydate文本),看起来不错,但是这次我无法按日期搜索

when i change the date/Time to Text (ps_entrydate Text), it looks fine but this time i can not search by date


永远不要做那件事,只需再次将数据类型更改为日期时间即可.
现在,您需要在水晶报表中格式化日期时间,仅此而已.在这里你

Crystal报表中的格式化日期 [


Never do that thing man, just change the the data type as into date time again.
Now you need to format the date time in crystal reports, that''s all. Here you go

Formatting Dates in Crystal reports[^]

Also you can use formula for the same thing. Example. ToText({ps_entrydate}, "dd-MMM-yyyy")


我也有同样的问题.有一个解决方法.也就是说,假设您要按日期(ps_entrydate)分组.如果不是,那我不知道该怎么告诉你.

但是,如果是这样,则报表将正确执行搜索,但不会正确显示结果.

对我而言,帮助显示的是日期(在您的情况下为ps_entrydate)两次,一次作为分组依据"字段显示,另一次作为报告中的字段显示.您会注意到报告字段正确显示,而组字段却没有正确显示.走吧.

确定日期字段正确显示后,请删除组字段,然后将其他日期字段替换为该字段.

Crystal Reports仍会按日期搜索组,但会在报表上显示日期字段,而不是组字段(实际上是相同的).
I had the same problem, I think. There is a work around for it. That is, assuming that you are grouping by the date (ps_entrydate). If not, then I don''t know what to tell you.

But if so, then the report performs the search correctly, but doesn''t display the result correctly.

What helped for me was to display the date, in your case ps_entrydate, twice, once as the group by field, and again as a field on the report. You''ll notice that the report field displays correctly, while the group field does not. Go figure.

Once you''re sure that the date field displays correctly, delete the group field and move the other date field in place of it.

Crystal Reports will still search on the group by date but will display the date field on the report, not the group field (which is actually the same).


非常感谢
thatraja177K

.您的链接有所帮助,我解决了问题.

也感谢您的报价

. your link helped and i solved the problem.

also thanks for your offer

ndrew Alix399


这篇关于水晶报表日期问题,请帮忙!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆