Avatar of printmedia
printmedia

asked on 

Display data in columns based on values in table in Crystal Reports

Hi all.

I'm working on a Crystal Report (14.0) the datasource is one table (myTable). The table has the following fields:

ModelNumber
ReportColumn1
ReportColumn2
ReportColumn3
ItemNumber
ProductDescription
PackagingString
UnitOfMeasure
Color
Dimensions

The report will pull the ModelNumber and only the fields (ItemNumber, ProductDescription, PackagingString, UnitOfMeasure, Color and Dimensions) that are in the ReportColumn1, ReportColumn2 and ReportColumn3 fields. So, let's say we have ModelNumber = ABC and ReportColumn1 = ProductDescription, ReportColumn2 = UnitOfMeasure, ReportColumn3 = Color, so only the data for those 3 fields will appear on the report for ModelNumber ABC.

We could have another ModelNumber = DEF have ReportColumn1 = ItemNumber, ReportColumn2 = Dimensions and ReportColumn3 is blank. So the report would only show the data for the ItemNumber and Dimensions fields for ModelNumber DEF.

Data in myTable:
ModelNumber--ReportColumn1--ReportColumn2--ReportColumn3--ItemNumber--ProductDescription--PackagingString--UnitOfMeasure--Color--Dimensions
ABC--ProductDescription--UnitOfMeasure--Color--Item1--Yellow pencil--50 pencils per box--EA--Yellow--2" x 8"
DEF--ItemNumber--Dimensions--<blank>--Item2--Red crayon--12 crayons per box--EA--Red--1" x 4"

How it should display in the report:
ABC--Yellow pencil--EA--Yellow
DEF--Item2--1" x 4"

I would also need to display the column header based on the field that appears for each column.

Any idea if this is possible in Crystal Reports?

Thank you in advance!
Crystal Reports

Avatar of undefined
Last Comment
Mike McCracken

8/22/2022 - Mon