November 09, 2007, 10:33 AM
JeffWardSuppressing row printing in Report Painter
Okay I'm new so be kind... Here's my scenario I have a report that I only want to print a row of data when a condition is met. I have searched high and low for a way to do this - I can apply all sorts of formatting but I really want to suppress the data. Any thoughts appreciated.
November 09, 2007, 10:48 AM
Leahquote:
Here's my scenario I have a report that I only want to print a row of data when a condition is met. I have searched high and low for a way to do this
Question, is the other data needed for any reason in the report? If not use WHERE as a screening to obtain only the data you need. Otherwise, you may have to do tricky things with subfoots looking like data or headings.
November 09, 2007, 10:57 AM
JeffWardI have a series of groups records with counts - if the count exceeds another field in the record I want that row to print. In Crystal there is a "suppress" feature on the group where one can apply a condition - hoping WF had something similiar.
November 09, 2007, 11:27 AM
FransSomething like this:
DEFINE FILE CAR
NEWFIELD/I9= IF SEATS GT DOORS THEN SEATS ELSE 0;
END
TABLE FILE CAR
PRINT NEWFIELD
WHERE NEWFIELD GT 0;
END
November 09, 2007, 11:31 AM
mgrackinThe code posted by FRANS will work if you are using the PRINT verb. If you are using the SUM or COUNT verb, use the WHERE TOTAL statement.
Here is an example. I realize I used PRINT in the example but it illustrates the WHERE TOTAL statement.
TABLE FILE CAR
PRINT RCOST DCOST RPM
BY COUNTRY
BY CAR
WHERE TOTAL RPM GT DCOST;
ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR=LIME, WHEN=RPM GT DCOST,$
ENDSTYLE
END
November 09, 2007, 11:36 AM
mgrackinDon't let the word TOTAL confuse you. The term 'WHERE TOTAL' is a key phrase. It does not total anything. It just indicates that the comparison should be done AFTER the aggregation (TOTALing) of the verb object fields (RCOST DCOST RPM).
November 09, 2007, 10:27 PM
TexasStingrayHere it is in a COMPUTE maybe a little easier to understand.
TABLE FILE ....
PRINT
...
...
AND COMPUTE COND/A1 = IF ... EQ ... THEN 'Y' ELSE 'N'; NOPRINT
WHERE TOTAL COND EQ 'Y';
END
Replace the ... with your code.
Hope this helps.