Crystal Reports Writer

Posted on 2012-08-22
Medium Priority
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
  • 3
  • 2
LVL 101

Expert Comment

ID: 38321461
Have you tried using a cross tab?


Author Comment

ID: 38321826
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 101

Expert Comment

ID: 38322777
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

ID: 38343014
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 101

Accepted Solution

mlmcc earned 1500 total points
ID: 38343322
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.


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

807 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