我可以在运行时将水晶报表中的字段移动到另一个位置吗? [英] Can I Move fields in a Crystal Report to another position when run?

查看:14
本文介绍了我可以在运行时将水晶报表中的字段移动到另一个位置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为不同的客户生成发票.一些客户有销售津贴.对于那些客户,我想显示一个额外的销售津贴单位和总成本列.

I am generating an invoice for various clients. Some clients have a sales allowance. For those clients I want to display an extra sales allowance unit and total cost column.

如果任何最大销售成本总计 = 0,我想将字段移到左侧并在右侧显示销售津贴

If any maximum sales cost total is = 0 I want to move the fields to the left and display the sales allowance on the right side

当客户有销售津贴时

------------------Headings extend all the way across the report-----------------------------

Description   Qty    UOW      Client Unit Cost   Client Cost    Sales Unit Cost   Sales Cost
============================================================================================
Something       5   Each                $11.00        $55.00              $5.00       $25.00
More Stuff      2   Each                $20.00        $40.00              $5.00       $10.00
============================================================================================
Totals                                                $55.00                          $35.00

当客户没有销售津贴时

------------------Headings extend all the way across the report-----------------------------

Description                                   Qty    UOW      Client Unit Cost   Client Cost
============================================================================================
Something                                       5   Each                $11.00        $55.00
More Stuff                                      2   Each                $20.00        $40.00
============================================================================================
Totals                                                                                $95.00

我们的目标是将此功能放入单个报告中,而不必知道在获得销售津贴时为哪个客户运行哪个报告.

The goal is to put this functionality into a single report rather than having to know which report to run for which client if and when they get a sales allowance.

我知道我们可以抑制字段,当我尝试合并时,我会在中间的右侧得到空格,具体取决于我放置字段的位置,结果是不可接受的.有没有办法在满足条件时将字段移动到不同的 LEFT 位置?这将是报告范围内的,而不是针对每个详细记录进行评估.

I know we can supress fields and when I tried to incorporate that I got whitespace on either the right of middle depending on where I placed the fields and the result was not acceptable. Is there a way to move a field to a different LEFT position when conditions are met? This would be report wide, not evalutated on each detail record.

推荐答案

如果您创建两个标题部分和两个详细信息部分,每个部分都包含您想要的字段和标题,那会更容易.根据 sales-allowance 字段 (Isnull({table.sales_allowance}) 中存在的值抑制相关的标题/详细信息部分.如果无法确定,请使用参数字段来驱动抑制公式.

It would be easier if you create two header sections and two detail sections with the fields and headers that you want in each. Suppress the relevant header/detail section based on the presence of a value in the sales-allowance field (Isnull({table.sales_allowance}). If this can't be determined, use a parameter field to drive the suppression formulae.

** 编辑 **

报告将包含两个标题部分(HA 和 HB)和两个详细信息部分(DA 和 DB).医管局DA 与 HB 和 HB 一起工作.D B.对有销售津贴的客户使用A"组;对没有的客户使用B"组.将相关字段添加到每个部分和标题;相应的空间.

the report will have two header sections (HA & HB) and two detail sections (DA & DB). HA & DA work in combination, as do HB & DB. Use the 'A' set for customers with a sales allowance; use the 'B' set for customers without. Add the relevant fields to each section and header; space accordingly.

设置HA & 的抑制公式DA到:

Set the suppression formula for HA & DA to:

//suppress section if there IS NOT a sales allowance
Not(Isnull({table.sales_allowance}))

设置HB & 的抑制公式数据库到:

Set the suppression formula for HB & DB to:

//suppress section if there IS a sales allowance
Isnull({table.sales_allowance})

您不需要使用这种方法抑制任何单个字段,从而消除了间距问题.

** 编辑 **虽然水晶报表对象确实具有 X(左)、Y(上)、宽度和高度属性,但只有 X 和宽度支持条件公式 (CF).您可以通过将字段的 X 属性的条件公式设置为另一个值来移动字段.

** edit ** while crystal report objects do have X (left), Y (top), width, and height properties, only X and width support conditional formulae (CF). you could move a field by setting the conditional formula of a field's X property to another value.

但是,这种方法更难维护.每个字段的 CF 都需要记住"两个位置:可见和隐藏.此外,如果将来添加另一个字段,则需要检查每个可移动"字段以确保其 CF 中的定位准确.

this approach would be harder to maintain, however. each field's CF would need to 'remember' two positions: visible and hidden. moreover, if another field was added in the future, each 'moveable' field would need to be reviewed to ensure that the positioning in its CF is accurate.

这篇关于我可以在运行时将水晶报表中的字段移动到另一个位置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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