Focal Point
Suppressing row printing in Report Painter

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8731094652

November 09, 2007, 10:33 AM
JeffWard
Suppressing 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.


WebFOCUS 7.7.0.3
Wintel/Windows SQL Server 2008
Output: PDF, HTML, XLS
November 09, 2007, 10:48 AM
Leah
quote:
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.


Leah
November 09, 2007, 10:57 AM
JeffWard
I 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.


WebFOCUS 7.7.0.3
Wintel/Windows SQL Server 2008
Output: PDF, HTML, XLS
November 09, 2007, 11:27 AM
Frans
Something 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


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
November 09, 2007, 11:31 AM
mgrackin
The 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


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
November 09, 2007, 11:36 AM
mgrackin
Don'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).


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
November 09, 2007, 10:27 PM
TexasStingray
Here 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.




Scott