Skip to Content
0
Oct 25, 2019 at 12:31 PM

Assistance for an empty string, CrystalReports v.2011

61 Views

Hello there guys,

I'm currently working on a report via Crystal reports, v.2011 and succeeded with almost everything but this. Hope that you will be able to help me J
To introduce you to the report - we have a DB with identical items in it and their count in another field, so basically the last variant of this report was outputting the same item over and over with the counts assigned to it. For example let's say that we have records for some chairs and their count. The previous report was going to look as follows if the input was identical:

Table1:

Item Count
Chairs 2
Chairs 3
Chairs 2
Tables 2
Chairs 3

Currently we have managed to summarize the counts for each identical item so the report above will look like as follows now:

Table2:

Item Count

Chairs 10
Tables 2.

I've managed to do it by sorting the items in alphabetic order, suppressing sections in case the items are repeating on the bottom row and then running totals with comparing if the next item is similar to the previous(same as the suppression) and if yes - then continue, if not - then reset the total. Here is the formula:


if next ({Table1.Item}) <> {Table1.Item} then false
else true;


This is exactly what leads to the issue - when reaching the last existing record in the last cell, the item is getting compared by the next one which doesn't match, therefore it is combining the last two records when they are not matching. So, if we are looking at Table2 with the formula applied it will look the following way:

Item Count
Chairs 10
Tables 12

Basically I am in need of some assistance regarding the way of defining to stop the count when hitting the last empty string. I am not sure if the explanation was clear enough but in case you need anything additional as info - just let me know.

Thanks.