Is it possible to set up a page break when I use PDF output but not when using HTML? If a user just wanted to quickly run a report they can run it in HTML but if they need to print it, it would be better formatted for PDF and I would like to page break on each group.This message has been edited. Last edited by: MelissaReed,
WebFOCUS 8.0.09 Windows, All Outputs
February 08, 2016, 04:46 PM
BabakNYC
-SET &PB=IF &WFFMT EQ 'HTML' THEN '' ELSE 'PAGE-BREAK';
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY &PB
BY CAR
BY MODEL
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML,HTML>,<PDF,PDF>).Select an output type.
ON TABLE NOTOTAL
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET SQUEEZE ON
ON TABLE SET EMPTYREPORT ON
ON TABLE SET HTMLCSS ON
ON TABLE SET HTMLENCODE ON
ON TABLE SET CACHELINES 100
ON TABLE SET GRWIDTH 1
ON TABLE SET STYLE *
$
ENDSTYLE
END
WebFOCUS 8206, Unix, Windows
February 09, 2016, 10:45 AM
MelissaReed
Thank you, that works but when I try to open the report in the GUI part of App Studio after adding the code, I get errors and it will not open. Is there a way to do this so I don't lose the ability to edit the report in App Studio without the text editor?
WebFOCUS 8.0.09 Windows, All Outputs
February 09, 2016, 11:00 AM
BabakNYC
In App Studio, create a Procedure instead of a Report, so you can enter Dialogue Manager code. Below, I defined &PB to include the first BY field so I don't have to add &PB in manually. Everything opens in the GUI now.
-SET &PB=IF &WFFMT EQ 'HTML' THEN ' COUNTRY' ELSE ' COUNTRY PAGE-BREAK';
TABLE FILE CAR
SUM
RETAIL_COST
BY LOWEST &PB
BY CAR
BY MODEL
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML,HTML>,<PDF,PDF>).Select type of display output.
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
ENDSTYLE
END
This message has been edited. Last edited by: BabakNYC,
WebFOCUS 8206, Unix, Windows
February 09, 2016, 11:52 AM
j.gross
The object all sublime / we will achieve in time / to ... ...maintain GUI editor compatibility / while meeting the business requirements
Try this method:
DEFINE FILE CAR
WFFMT/A8='&WFFMT.(<HTML,HTML>,<PDF,PDF>).Select an output type.'; <-- Make &WFFMT a report variable (not essential, but makes next line neater)
BREAKER/A40= IF WFFMT EQ 'PDF' THEN COUNTRY ELSE 'Never' ; <-- define sort variable for conditional page-break
END
TABLE FILE CAR
SUM RETAIL_COST
BY BREAKER NOPRINT PAGE-BREAK <-- This will page-break on Country, only if format = PDF
BY COUNTRY <-- No page-break on COUNTRY itself
BY CAR
BY MODEL
ON TABLE PCHOLD FORMAT &WFFMT
ON TABLE NOTOTAL
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET SQUEEZE ON
ON TABLE SET EMPTYREPORT ON
ON TABLE SET HTMLCSS ON
ON TABLE SET HTMLENCODE ON
ON TABLE SET CACHELINES 100
ON TABLE SET GRWIDTH 1
ON TABLE SET STYLE *
$
ENDSTYLE
END
-- which should be compatible with the GUI editorThis message has been edited. Last edited by: j.gross,