简体   繁体   English

比较Crystal报表中的记录

[英]Comparing Records In Crystal Reports

So I want to compare some records in Crystal Reports to take care of a problem a bug in our system has caused. 因此,我想比较Crystal Reports中的一些记录,以解决我们系统中的错误引起的问题。

So every once in a while our system charges someone twice. 因此,我们的系统每隔一段时间就会向某人收取两次费用。 I want to find all those orders/shipments. 我想找到所有这些订单/货件。 An order can have multiple shipments (if we have one item on backorder we ship out the rest of the order in one shipment and then ship out the backordered item in another shipment). 一个订单可以有多个货件(如果我们有一个待补商品,则我们将剩余货品以一发货的方​​式运出,然后以另一货品的形式补货)。 The shipment also has a charge_date field that's a date time stamp when we charged the customer. 货件中还有一个charge_date字段,它是我们向客户收费时的日期时间戳。 So if we grouped it in Crystal reports it would look like this: 因此,如果我们在Crystal报表中将其分组,则它将如下所示:

    Order Id: 234587
              Shipment Id: 121    charge_date: 8/29/2012 11:43:21
              Shipment Id: 524    charge_date: 9/1/2012 15:37:39

Shipments are created in numerical order. 发货是按数字顺序创建的。 So if we send out one shipment, say shipment number: 345, then the next shipment we send out, regardless of what order it's a part of, will be shipment number: 346. 因此,如果我们寄出一个货件,例如货件号:345,那么无论寄出什么订单,我们寄出的下一个货件将是货件号:346。

So, when someone is a victim of our bug then their shipments are right after one another and their charge_date are exactly the same. 因此,当某人是我们的bug的受害者时,他们的出货量是一个接一个的,其charge_date也完全相同。 Like so: 像这样:

    Order Id: 69875
              Shipment Id: 594     charge_date: 9/2/2012 14:32:15
              Shipment Id: 595     charge_date: 9/2/2012 14:32:15

I can create a list of just shipments and their charge date (without grouping on Order Id) and sorting them in ascending order. 我可以创建一个仅列出货件及其收费日期的列表(不对订单ID进行分组),然后按升序对它们进行排序。 But what I want to do is iterate through the list of shipments and compare each shipment to the previous shipment and see if the charge_date 's are equal and if they are then select them or mark them or something so that I can group them by a formula and take care of them. 但是我想做的是遍历发货清单,将每个发货与上一个发货进行比较,看看charge_date是否相等,然后选择它们或对其进行标记,以便我可以将它们分组配方并照顾他们。

Is this possible in Crystal? 在Crystal中有可能吗? Should I use a different program? 我应该使用其他程序吗? I realize this might not be the best way to do this so I'm open to suggestions. 我意识到这可能不是执行此操作的最佳方法,因此我愿意提出建议。 Thanks in advance! 提前致谢!

Can you create groups for the orderID and chargeDate, then suppress all shipment details unless the count(shipmentID) > 1? 是否可以为orderID和chargeDate创建组,然后取消所有货件详细信息,除非count(shipmentID)> 1?

You'd display the shipment details in the chargeDate group footer. 您将在chargeDate组页脚中显示货件详细信息。

Use the Previous function: 使用上Previous功能:

// {@Is Error}
If Previous({table.chargeDate})={table.chargeDate}) Then
  true
Else
  false

Insert a group in this formula. 在此公式中插入一个组。

I'm not able to test this, as I'm not at my work computer. 我不在工作电脑上,因此无法测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM