Search code examples
crystal-reports

Compress Date Range


I have a bunch of records in the format of

DATE         TYPE
----------   ------
06/21/2014   TYPE A
06/22/2014   TYPE A
06/23/2014   TYPE A
06/24/2014   TYPE B
06/25/2014   TYPE C
06/26/2014   TYPE C
06/27/2014   TYPE A
...

I would like to print out a report that showed the range of type where these parameters existed in sequence.

        START       END         LENGTH
        ----------  ----------  ------
TYPE A  06/21/2014  06/23/2014  3 
TYPE B  06/24/2014  06/24/2014  1
TYPE C  06/25/2014  06/26/2014  2
TYPE A  06/27/2014  06/27/2014  1

Is there any way to display the data in this format from the schema I have been given?


Solution

  • Try the following:

    1) Create a group by "type". In the group expert, configure it so that it will not order the result (i think it is called "in original order").

    2) Suppress the detail section.

    3) In the group footer, show the "type" field, put a summarize of minimum "date" (the start), put a summarize of maximum "date" (the end), put a summarize of count (the length).