C#和Crystal Reports SDK - 忽略选择条件 [英] C# and Crystal Reports SDK - Selection Criteria Ignored

查看:245
本文介绍了C#和Crystal Reports SDK - 忽略选择条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个水晶报告rpt文件从C#代码调用。报告工作原理与Studio 2010中的Designer一样。当从C#调用时,相同的报告忽略选择标准,但仅当在标准中包括某个表的字段时。



当前条件示例:

 日期({transaction.transaction_date})在{?FromTo}和
{user_branch.branch_id} = 1

{?FromTo}是一个日期范围参数, p>

当我删除branch_id部分时,正确地检查{?FromTo} date参数,并且数据按预期返回。但是,一旦我包括branch_id字段,所有的数据被返回,这根本没有意义。



通过设计器运行这个完全相同的报告,工作正确...通过C#SDK代码运行时出现问题。



任何帮助将非常感谢



已尝试




  • 逐页重新整理报表。这工作到一个点,我开始添加更多的字段到报告本身,没有人特别是,然后问题再次启动...显然,我开始回溯我的步骤,直到整个报告再次空,但

  • 在google中没有类似的问题...在我的代码中没有在代码行中清空的选择条件在代码...我的其他报告无法访问该表格。

  • 当前使用CR Runtime的版本13.0.1。尝试升级到13.0.2,仍然无法正常工作

  • 使用与报表直接针对数据库生成的完全相同的SQL。
  • 本周的许多令人头痛的问题,我终于找到了一个很好的解决方案。这个工作正常。




ie我将我的branch_id字段添加到报告的detail部分并将其抑制。



我在所有其他报告中测试了这个问题,并且它工作。


I have a crystal reports rpt file being called from C# code. Report works as expected from Designer within Studio 2010. Same report ignores Selection Criteria when called from C#, but ONLY when including a certain table's field in the criteria.

Current Criteria Example :

date({transaction.transaction_date}) in {?FromTo} and   
{user_branch.branch_id} = 1

{?FromTo} is a date range parameter which works perfectly

When I remove the branch_id section, the {?FromTo} date parameter is checked correctly and the data returns as expected. BUT, as soon as I include the branch_id field, ALL the data is returned, which does not make sense at all.

Running this exact same report via the designer, works correctly... The problem occurs when running via C# SDK code.

Any help with this will be GREATLY appreciated

Already Tried

  • Recreate Entire Report from Scratch bit by bit, table by table. This works up to a point where I start adding more fields to the report itself, no one in particular, then the problem starts up again... So obviously, I start back tracing my steps until the entire report is empty again, but the problem persists, like the file is now "broken"
  • No similar issues in google... No where in my code is a line emptying the selection criteria during code... My other reports not accessing that table works fine.
  • Currently using version 13.0.1 of the CR Runtime. Tried to upgrade to 13.0.2, still didn't work
  • Ran the exact same SQL that the report generated directly against the database. That works as expected.

解决方案

After many head-aches this week, I finally found the problem... This looks like a bug in the SDK itself though, but to solve the problem, just make sure that the field giving the problem mentioned above is contained in the detail section of the report.

i.e. I added my branch_id field to the detail section of the report and suppressed it. It works by suppressing the section as well, just as long as the field is contained there.

I tested this on all my other reports with the same problem and it worked.

这篇关于C#和Crystal Reports SDK - 忽略选择条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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