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 --ReportCo lumn2--Rep ortColumn3 --ItemNumb er--Produc tDescripti on--Packag ingString- -UnitOfMea sure--Colo r--Dimensi ons
ABC--ProductDescription--U nitOfMeasu re--Color- -Item1--Ye llow pencil--50 pencils per box--EA--Yellow--2" x 8"
DEF--ItemNumber--Dimension s--<blank> --Item2--R ed 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!
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
ABC--ProductDescription--U
DEF--ItemNumber--Dimension
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!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Unfortunately yes.
I'll do some more thinking to see if there might be an easier way
mlmcc
mlmcc
ASKER
There's a possibility that there are 50-75 fields, not just the 6 I put in my original question. Would I have to do an if-else for all of those fields?