Link to home
Start Free TrialLog in
Avatar of printmedia

asked on

Only display data set to YES in Crystal Report

Hi All.

Don't know if this is possible but going to give it a shot. We have a SQL table, myTable, that stores item numbers and descriptive information for item numbers:
Table fields: ItemNumber, ProductLine, ProductLineAppearOnReport, Height, HeightAppearOnReport, Width, WidthAppearOnReport, Color, ColorAppearOnReport, UnitOfMeasure, UnitOfMeasureAppearOnReport

As you can see each field has a "AppearOnReport" that will either be Yes or No.

We want to create a Crystal Report that will list the ItemNumber and only the fields that have the "AppearOnReport" equal to YES. The problem is that each item number will be different because some items we don't want to display the Height and Width on the Report while others we do. The problem is we don't want to display a blank where the field would display data if it was set to YES.

So for example, let's say we have item ABC (has ProductLineAppearOnReport = YES and ColorAppearOnReport = YES), item DEF (only has UnitOfMeasure = YES ) and item GHI (HeightAppearOnReport = YES and WidthAppearOnReport = YES) here's how the data should appear on the report:

GHI--12 feet--10 feet

As you can see there is no blank space where ProductLine or Color would be if it was set to YES for item DEF and the same for item GHI

Any idea if this can be done?

Thank you in advance!
Avatar of Raghavendra Hullur
Raghavendra Hullur
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike McCracken
Mike McCracken

What version of Crystal?

Avatar of printmedia


Version 14
Did you try the comment above?

Thanks for your suggestion Raghavendra! How would I handle the column headers? Would I do it the same way as the data as you suggested?
Yes, that would do. In case you need space between column headers, you can include the same by including space between quotes like Column 1 & '  ' & Column 2 etc..
That worked. Thanks!