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

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

问题描述

我为各种客户生成发票。有些客户有销售津贴。对于那些客户,我想显示一个额外的销售津贴单位和总成本栏。



如果任何最高销售成本总额= 0我想把字段移到左边并在右侧显示销售津贴



当客户有销售津贴

  ------------------标题在报表中一直延伸------------- ---------------- 

描述数量UOW客户单位成本客户成本销售单位成本销售成本
========= ==================================================== =============================
东西5每$ 11.00 $ 55.00 $ 5.00 $ 25.00
更多的东西2每$ 20.00 $ 40.00 $ 5.00 $ 10.00
====================================== ==================================================== ==
总计$ 55.00 $ 35.00

当客户没有销售费用

  ------------------标题一直延伸整个报告----------------------------- 

描述数量UOW客户单位成本客户成本
================================================东西5每$ 11.00 $ 55.00
更多东西2每$ 20.00 $ 40.00
================================== ================================================== =========
总计$ 95.00

目标是将此功能集成到单个报告中,而不必知道要为哪个客户机运行哪个报告,以及何时获得销售补贴。



我知道我们可以压缩字段,试图结合,我在中间的右边空白,取决于我放置的字段,结果是不能接受的。是否有办法在满足条件时将字段移动到不同的左侧位置?

解决方案

如果您创建两个标题部分和两个详细信息部分,其中包含您想要的字段和标题。根据销售额字段(Isnull({table.sales_allowance})中是否存在值来抑制相关的标题/详细信息部分,如果无法确定,请使用参数字段来驱动抑制公式。 p>

**编辑**



报表将包含两个标题部分(HA& HB) (DA& DB),HA& DA与HB& DB组合使用,对于具有销售津贴的客户使用'A'集合;对没有客户的客户使用'B'集合。



将HA和DA的抑制公式设置为:

  //抑制部分如果没有销售津贴
不是(Isnull({table.sales_allowance}))

将HB& DB的抑制公式设置为:

  //抑制部分如果有销售津贴
Isnull({table.sales_allowance})


b $ b

您不需要使用此方法压缩任何单个字段,从而消除间距问题。



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



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


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.

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

When the client has sales allowance

------------------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

When the client does not have sales allowance

------------------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.

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.

解决方案

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.

** edit **

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.

Set the suppression formula for HA & DA to:

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

Set the suppression formula for HB & DB to:

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

You do NOT need to suppress any individual fields with this approach, thus eliminating the spacing issue.

** 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.

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.

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

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