Crystal Reports Writer

Posted on 2012-08-22
Last Modified: 2012-09-04
I need to collapse a group of similiar records into one record for display,
and then do the same for another group of records. I am not sure how to do it.

Example records are:

                    Category         period                value
      ---------          ---------               --------
record #1      "Stocks"        "6month"                1.00
record #2      "Stocks"        "12month"              3.45
record #3      "Stocks"        "24month"             10.34
record #4      "Stocks"        "36month"             11.78

And here is how I need them to appear on the report:

category            6mo         12month       24month      36month
stocks               1.00               3.45             10.34          11.78
Question by:DJP236
    LVL 100

    Expert Comment

    Have you tried using a cross tab?


    Author Comment

    I have not with this particulr report. Is there a way to do this in a standard report form via formulas or hidden fields?
    LVL 100

    Expert Comment

    Sure.  A cross tab would do it directly.

    Can there be multiple records for each period?

    If so are you summing the values?

    Are there other periods?


    Author Comment

    Hi mlmcc,

     I guess I wasn't clear -
    I was trying to get by without using a crosstab. I evenually used the crosstab via a subreport but should not have had to because the tables used were indexed and linked. The issue with the tables is key fields are one too many relationship which created a seperate detail line for each. I needed the data formatted vertically into one record or within a single Details line.
     Is there a way to do this outside of a crosstab? Thanks.
    LVL 100

    Accepted Solution

    There are ways of doing it with variables and putting the results in the group footer.  That was the intent of the questions I asked to see how much effort it would take.

    The real problem is if the number of periods can change or the periods themselves can change.  WIth variables you have to know ahead (design time) how many columns to plan for.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now