Skip to Content

Assistance for an empty string, CrystalReports v.2011

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Oct 28, 2019 at 08:18 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.