Crystal Reports 2008 - 参数类型问题 [英] Crystal Reports 2008 - Problem with Parameter Type

查看:656
本文介绍了Crystal Reports 2008 - 参数类型问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Crystal 2008报表使用存储过程来访问SQL Server 2008数据库。存储过程使用类型为Date的参数(SQL Server 2008的新增)。

I have a Crystal 2008 report hitting a SQL Server 2008 database using a stored procedure. The stored procedure takes a parameter of type Date (new to SQL Server 2008).

当Crystal在报表中为我自动创建参数时,它使参数成为String类型。我不想要一种类型的字符串,因为那么用户需要输入一个日期,没有看到他/她会看到如果参数类型为日期的水晶日期对话框。问题是,Crystal不允许我将参数类型更改为我想要的类型。

When Crystal automatically creates the parameter for me in the report, it makes the parameter a type of String. I don't want a type of String because then the user is required to type in a date and doesn't see the Crystal date dialog that he/she would see if the parameter type is Date. The problem is that Crystal is not allowing me to change the parameter type to the type I want.

我不想将存储过程参数更改为dateTime类型,因为Crystal将创建一个datetime的报表参数类型,并且用户需要输入时间值。我也不想要这个。

I don't want to change the stored procedure parameter to a dateTime type because then Crystal would create a report parameter type of datetime and the user would be required to enter a time value. I don't want this either.

我在这里有什么选择吗?

Do I have any options here?

推荐答案

一种可能性是在子报表中使用datetime参数报告过程,在主报表中创建仅限日期的参数并将主报告中的仅日期参数与子报表中的datetime参数链接。

One possibility might be to report from the procedure with datetime parameters in a subreport, create date-only parameters in the main report and link the date-only parameters in the main report with the datetime parameters in the subreport.

Crystal 10(我使用的)不允许将仅日期连接到日期时间参数,但Crystal 2008可能 - 如果不是,则在主报表中创建公式以转换将仅日期参数更改为datetime(具有时间为午夜)值。

Crystal 10 (which I use) won't allow linking date-only to datetime parameters, but Crystal 2008 might - if not, create formulas in the main report to convert the date-only parameters to datetime (with time as midnight) values.

这篇关于Crystal Reports 2008 - 参数类型问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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