cancel
Showing results for 
Search instead for 
Did you mean: 

Assistance for an empty string, CrystalReports v.2011

0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi,

You need to "Group" on the Item field and insert a sum on the Count field.

1. Go to the Group Expert and select the "Item" field to Group on

2. Next, go to the Insert item on the menu bar > Select Summary > Choose "Count" as the field to summarize and set its aggregation to "Sum".

3. Choose the "Summary Location" as Group Footer

4. Move the Item field to the Group Footer and suppress the Details and Group Header sections.

-Abhilash