水晶报表:记录选择公式 [英] Crystal Reports : Record Selection Formulas

查看:107
本文介绍了水晶报表:记录选择公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,专家,

我是Crystal Report世界中的新手:)

关于创建记录选择公式,我需要一些帮助:

1.如何根据日期[dd/mm/yyyy]范围过滤记录?该报告将获得两个DATE参数"fromDate"和"迄今为止".您能告诉我如何制作此公式吗?

2.如何根据时间[mm:hh]范围过滤记录?该报告将获得两个DATE参数"fromTime"和"toTime".您能告诉我如何制作此公式吗?

3.我有一个参数"CompanyName",如果用户提供了该参数,则应为该特定公司选择数据,否则应显示所有公司数据.如何创建此公式?

4.我要创建摘要字段,该字段将是特定值的计数,在报告的某些特定列中说"XYZ".如何创建这样的公式?

谢谢
BR
SC

Hi Experts,

I am newbie in crystal report world :)

I need some help regarding creating record selection formulas:

1. How to filter records on the base of date [dd/mm/yyyy] range? The report will get two DATE parameters "fromDate" & "toDate". Can you please tell how to make this formula?

2. How to filter records on the base of time [mm:hh] range? The report will get two DATE parameters "fromTime" & "toTime". Can you please tell how to make this formula?

3. I have one parameter "CompanyName" which if user provides then the data should be selected for that specific company otherwise all companies data should appear. How to create this formula?

4. I want to create summary field which will be count of specific value lets say "XYZ" in some particular column of report. How to create such formula?

Thankx
BR
SC

推荐答案

OP写道:

1.如何根据日期[dd/mm/yyyy]范围过滤记录?该报告将获得两个DATE参数"fromDate"和"迄今为止".您能告诉我如何制作此公式吗?

1. How to filter records on the base of date [dd/mm/yyyy] range? The report will get two DATE parameters "fromDate" & "toDate". Can you please tell how to make this formula?


试试这个 C#Crystal Reports-日期到日期 [ ^ ]


Try this C# Crystal Reports - Date to Date [^]

OP写道:

2.如何根据时间[mm:hh]范围过滤记录?该报告将获得两个DATE参数"fromTime"和"toTime".你能告诉我如何做这个公式吗?

2. How to filter records on the base of time [mm:hh] range? The report will get two DATE parameters "fromTime" & "toTime". Can you please tell how to make this formula?


这对您有帮助
创建高级记录选择公式 [


This will help you
How to Correct this selection Formula to show time in AM or PM[^]
This one is great
Creating Advanced Record Selection Formulas[^](It contains all type of things)

OP写道:

3.我有一个参数"CompanyName",如果用户提供了该参数,则应为该特定公司选择数据,否则应显示所有公司数据.如何创建此公式?

3. I have one parameter "CompanyName" which if user provides then the data should be selected for that specific company otherwise all companies data should appear. How to create this formula?


试试这个
使用选择公式创建报告 [ ^ ]
将所选公司的价值发送至选择公式,仅此而已.


Try this Creating a Report with a Selection Formula[^]
Send the selected company value to the selection formula, that''s all.

OP写道:

4.我想创建摘要字段,该字段将是特定值的计数,在报告的某些特定列中说"XYZ".如何创建这样的公式?

4. I want to create summary field which will be count of specific value lets say "XYZ" in some particular column of report. How to create such formula?


在这里,您可以晶体报告摘要"字段 [ ^ ]


您遇到什么错误?
我认为您需要将Block()用作If块.


Here you go Crystal Reports Summary Field[^]


What error you are getting?
I think you need to put block() for If block.

{EMPLOYEE.BIRTHDATE} >= {?FromDate} and {EMPLOYEE.BIRTHDATE} <= {?ToDate} and 
//(
// If (StrCmp({?DeptName},"") = -1) Then 
// (  
   {EMPLOYEE.WORKDEPT} = {?DeptName} //Append this by condition in front-end.
// )
//)


然后像上面一样注释if块,实际上在前端(java)中检查是否已选择DeptName的条件.如果是,则在选择公式中附加DeptName,否则以fromdate&停止.迄今为止的事情.
如果选择了DeptName,则


Then comment the if block like above, Actually in front end(java) check the condition if DeptName has selected or not. If yes then append the DeptName thing in selection formula else stop with fromdate & todate things.
If DeptName selected then

{EMPLOYEE.BIRTHDATE} >= {?FromDate} and {EMPLOYEE.BIRTHDATE} <= {?ToDate} and
   {EMPLOYEE.WORKDEPT} = {?DeptName}


其他


else

{EMPLOYEE.BIRTHDATE} >= {?FromDate} and {EMPLOYEE.BIRTHDATE} <= {?ToDate} 


发送此选择公式以在Java运行时进行报告.
让我们知道.

待处理的查询


Crystal Reports需要帮助. (如何按条件求和) [ ^ ]

[/Edit]


Send this selection formula to report at runtime in java.
Let us know.

Pending query


Need help in Crystal Reports. (how to sum by conditions)[^]

[/Edit]


这篇关于水晶报表:记录选择公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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