简体   繁体   English

当报表添加到报表中时,Crystal Reports会删除所有具有Null值的数据

[英]Crystal Reports eliminating all data with a Null value when it is added to a report

I've got a report that has always worked. 我有一份始终有效的报告。 Basically, the report runs against the database using Catapult (back office PC system for our retail stores). 基本上,该报告使用Catapult(我们零售商店的后台PC系统)针对数据库运行。 The purpose of the report is to get a file that has some basic information that will be pulled for labels later. 该报告的目的是获得一个包含一些基本信息的文件,以后将为标签提取这些信息。

I'm having an issue now. 我现在有问题。 I wanted to find a way to add a "Promo Price" field to this report. 我想找到一种在此报告中添加“促销价格”字段的方法。 To do this, I pulled in another table (view) from our database and linked the tables to allow me to show the "Promo Price" (DIS_Description). 为此,我从数据库中提取了另一个表(视图),并链接了这些表以显示“促销价”(DIS_Description)。 Now, I place the field (DIS_Description) in the report and run it. 现在,我将字段(DIS_Description)放在报告中并运行它。 It works perfectly to show me the Promo Price field for records that actually have a Promo Price (again, managed in Catapult itself). 它非常适合向我显示“促销价格”字段,用于记录实际上具有促销价格的记录(同样由Catapult本身管理)。 But, for records that have no value to the DIS_Description, they won't be shown at all. 但是,对于没有DIS_Description值的记录,将根本不会显示它们。 I'm not filtering the report, so I can't simply throw a "OR ISNULL({DIS_Description})" to fix this. 我没有过滤报告,因此不能简单地抛出“ OR ISNULL({DIS_Description})”来解决此问题。

Is there a way to show records that don't have a value for this field? 有没有办法显示该字段没有值的记录? I've even tried creating the following formula and using that in the report instead of the DIS_Description field itself: 我什至尝试创建以下公式,并在报表中而不是DIS_Description字段本身中使用该公式:

IF ISNULL({DIS_Description}) IF ISNULL({DIS_Description})

THEN "" 然后 ””

ELSE {DIS_Description} 否则{DIS_Description}

This still returns no data unless the field has a value. 除非该字段具有值,否则仍不返回任何数据。 The second that I remove that field from the report, it shows everything as it should. 我第二次从报告中删除该字段,它显示了所有应有的内容。 Any ideas here? 这里有什么想法吗?

Ok, I was poking around with the table links, and I think I figured it out. 好的,我正在四处浏览表格链接,我想我已经知道了。 The join was an INNER JOIN (not 100% sure what the different types of joins mean). 联接是一个内部联接(不是100%确定不同类型联接的含义)。 I tried changing it to the others. 我尝试将其更改为其他。 LEFT OUTER JOIN returned the same problems. LEFT OUTER JOIN返回了相同的问题。 I then tried RIGHT OUTER JOIN and it seems to be returning my data perfectly... 然后我尝试了RIGHT OUTER JOIN,它似乎完美地返回了我的数据...

Anyone care to explain why? 有人在乎解释为什么吗? At least I have the answer now. 至少我现在有答案。

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

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