Focal Point
[SOLVED] COMPOUND LAYOUT

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

January 05, 2011, 02:33 PM
Michelle Skaggs
[SOLVED] COMPOUND LAYOUT
I am hoping someone can point me in the right direction or tell me it cannot be done this way.

I am writing a online proposal generator. The user can propose as many "products" as they choose. Currently each product has it's own fex. I am using COMPOUND LAYOUT PCHOLD FORMAT PDF for each product proposal. Individually they are working great.

What I would like to do is merge them into one document for displaying, printing, and saving for the end user.

I have scoured the COMPOUND LAYOUT documentation but I don't really see anything like I would like to do. Here is the just of what I would like to do:

-*Staring Point.fex
SET COMPOUND=OPEN
-INCLUDE PRODUCT1.fex

SET COMPOUNT=CLOSE
-INCLUDE PRODUCT2.fex

I've tried using IF statements inside of the Document Composer fex but that doesn't seem to work.

Basically, I would like conditional SECTIONS in the COMPOUND LAYOUT but if I am reading the documentation correctly, you can only have one SECTION.

I hope this rambling makes sense and any comments, suggestions, and/or advice would be welcome.

This message has been edited. Last edited by: Kerry,


DevStudio Version 7701
WebFocus 7.7 Windows Server 2003 PDF Format
January 05, 2011, 03:13 PM
jimbo
Michelle,
I think I know what you are trying to do, but I need some clarification. Basically a user selects a product or a series of products. Each one of those has a related FEX that is run and you want consolidated into one compound ddocument. Correct?


7.7.04
Win2K3, Unix
Oracle 10G,SQL2K,XFOCUS,ESRI,BID,MRE,SELF-SERVICCE
January 05, 2011, 03:45 PM
Michelle Skaggs
That is exactly what I am trying to do. I had something similiar but I kept getting errors. Still learning. Thanks again!!!


DevStudio Version 7701
WebFocus 7.7 Windows Server 2003 PDF Format
January 05, 2011, 04:01 PM
jimbo
OK here is something we do. Just to outline and some background. This is for earning / commission statements, with each component having it's own unique ID and detailed fex. We typically present the statment(s) as HTML and the user gets to drill from a high level summary, to a line item summary to a detail of all the records within each line item. So we provided a feature that instead of having to navigate through all of the drill downs/ statements why not grovide a facility to get all the related summaries and detailed staements in a one-click fashion for the users earning records or review. Just note that a) each ID and fex name is sitting in a table b) the first report is always the same and the we dummy up a closing report (for the compund close). Perhaps in your case you could create a standard opening and closing report but I think you can


-INCLUDE WEB_RPTRECAPSUM
-INCLUDE WEB_RPTRECAPSUMDTL
-SET &CTYPE='X' ;
-INCLUDE WEB_RPTMISCADJ
-* this section takes the users line item results(which vary from user to user and number in the hundreds) to a table that has each line item ID PLUS the detailed fex name for that ID.
JOIN COMMTYPE IN COMMALLX TO COMMTYPE IN REPORTOPTION AS JR
DEFINE FILE COMMALLX
 PER_MYY/MYY = PER_DATE;
 CHECKCOMM/A33 = IF RPTNAME GT ' ' THEN RPTNAME ELSE 'NO STATEMENT' ;
END
TABLE FILE COMMALLX
WHERE PER_MYY EQ '&cycle'  ;
WHERE CHECKCOMM NE 'NO STATEMENT'
SUM COMMTYPE
CHECKCOMM
BY COMMNAME
ON TABLE SAVE AS RPTSAVE FORMAT ALPHA
END
-RUN
-SET &RPTCOUNT = &LINES ;
-DEFAULT &ICOUNT = 0 ;
-REPEAT RPTLOOP FOR &ICOUNT FROM 1 TO &RPTCOUNT
-READ RPTSAVE NOCLOSE &COMMNAME.A40. &CTYPE.A4. &_FEXNAME.A33.
-IF &IORETURN NE 0 GOTO DONE_IO ;
-* pull stmt
-INCLUDE &_FEXNAME
-RPTLOOP
-DONE_IO
-CLOSE RPTSAVE
-*
-*!!! set compound must be placed before last report
SET COMPOUND=CLOSE
TABLE FILE COMMALLX
WHERE RECORDLIMIT EQ 1
PRINT COMMNAME NOPRINT
HEADING CENTER
""
"END COMMISSIONS STATMENTS"
""
-INCLUDE INC_COMMSTYLE
 ENDSTYLE
-INCLUDE INC_COMM_RPT_OUTPUT
-*  



7.7.04
Win2K3, Unix
Oracle 10G,SQL2K,XFOCUS,ESRI,BID,MRE,SELF-SERVICCE
January 06, 2011, 09:02 AM
linus
There's a way to do this without the dummy report at then end. Here's how I do it: To do it this way, remove your SET COMPOUND statements.

 
-DEFAULT &LOOPCTR = 0;
-DEFAULT ®ION = 'MWR';

-***********
-NEXT_REGION
-***********

-SET &LOOPCTR = &LOOPCTR + 1;
-SET ®ION = IF &LOOPCTR EQ 1 THEN 'MWR' ELSE
- IF &LOOPCTR EQ 2 THEN 'NER' ELSE
- IF &LOOPCTR EQ 3 THEN 'NPR' ELSE
- IF &LOOPCTR EQ 4 THEN 'SOR' ELSE 'SWR';

-SET &CMPND = IF &LOOPCTR EQ 1 THEN 'OPEN'  ELSE
- IF &LOOPCTR EQ 5 THEN 'CLOSE' ELSE '';
-RUN
TABLE FILE SALES
PRINT SALES_AMT
BY REGION
ON TABLE PCHOLD FORMAT EXL2K &CMPND.EVAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,
     GRID=ON,
  FONT='ARIAL',
  SIZE=9,
  COLOR='BLACK',
  STYLE='NORMAL',
  TOPGAP=0.013889,
  BOTTOMGAP=0.027778,
  WRAP=.85,
$
TYPE = REPORT, TITLETEXT = 'Sales-®ION.EVAL' ,$
TYPE=FOOTING, STYLE=BOLD,$
ENDSTYLE
END
-RUN

-IF &LOOPCTR LT 5 GOTO NEXT_REGION;




WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
January 07, 2011, 01:22 PM
Michelle Skaggs
Thanks for all the input. Someone posted a way to do exactly what I wanted but I don't see the posting here now, so Thanks to whomever.

The solution was to have -IF conditions inside the COMPOUND LAYOUT. I had tried this before but was getting an error so I assumed it did not work. I think the error is with DevStudio though. The fex runs perfectly and does exactly what I want but now I cannot edit the fex inside the Document Composer Window. Is this an issue with the Document Composer or am I lacking a setting somewhere.

Many thanks for all the input. This forum is excellent.


DevStudio Version 7701
WebFocus 7.7 Windows Server 2003 PDF Format
January 07, 2011, 02:37 PM
Tom Flynn
Hi Michelle,

That was me, not trying to receive kudos, but, I deleted the post after others gave examples and it seemed that was what you were looking for. I have added the code back in.

I don't use the GUI, although, I did use it to capture the code. I then code on my own.

Dialogue Manager can be used throughout ANY program, the programs will just not open back up in the GUI. Just copy the original to a test fex, and, remove the DM code, test your changes, then put the DM code back in...

hth others, too!

  
-* File fin_pdis_compound_pdf
-DEFAULT &FMT='PDF'
SET HTMLARCHIVE=ON
COMPOUND LAYOUT PCHOLD FORMAT &FMT
UNITS=IN, $
-*OBJECT=TOC, NAME='text1', TEXT='<font face="ARIAL" size=10>Table of Contents</font>', MARKUP=ON, TOC-NUMBERING=ON, POSITION=(0.854 0.854), DIMENSION=(9.500 7.000), font='ARIAL', color=RGB(0 0 0),  size=10, METADATA=' TOCTITLE: Table of Contents', $
OBJECT=bookmarks ,$
SECTION=section1, LAYOUT=ON, METADATA='0.5^0.5^0.5^0.5', MERGE=OFF, ORIENTATION=PORTRAIT, PAGESIZE=Letter,  $

-IF &FMT EQ 'EXL2K' GOTO SKIP_RPT1;
PAGELAYOUT=1, NAME='Page layout 1', text='Banner Purchase Order Book', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report1', TEXT='report1', TOC-LEVEL=0, POSITION=(0.667 0.502), DIMENSION=(9.834 7.498), METADATA='Z-INDEX: 100; LEFT: 0.667in; OVERFLOW: auto; WIDTH: 9.834in; POSITION: absolute; TOP: 0.502in; HEIGHT: 7.498in', $
-SKIP_RPT1

PAGELAYOUT=2, NAME='Page layout 2', text='Purchase Order Summary', TOC-LEVEL=1, ORIENTATION=LANDSCAPE, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
-*                                                          LEFT   TOP               WIDTH HEIGHT
COMPONENT='report2', TEXT='report2', TOC-LEVEL=0, POSITION=(0.502 0.057), DIMENSION=(10.002 12.498),METADATA='Z-INDEX: 101; LEFT: 0.502in; OVERFLOW: auto; WIDTH: 10.002in; POSITION: absolute; TOP: 0.097in; HEIGHT: 12.498in', $

PAGELAYOUT=3, NAME='Page layout 3', text='Purchase Order Detail',  TOC-LEVEL=1, ORIENTATION=LANDSCAPE, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report3', TEXT='report3', TOC-LEVEL=0, POSITION=(0.480 0.200), DIMENSION=(10.599 9.498), METADATA='Z-INDEX: 102; LEFT: 0.480in; OVERFLOW: auto; WIDTH: 10.599in; POSITION: absolute; TOP: 0.200in; HEIGHT: 9.498in', $

PAGELAYOUT=4, NAME='Page layout 4', text='Purchase Order Listing',  TOC-LEVEL=1, ORIENTATION=LANDSCAPE, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report4', TEXT='report4', TOC-LEVEL=0, POSITION=(0.480 0.200), DIMENSION=(10.599 9.498), METADATA='Z-INDEX: 103; LEFT: 0.480in; OVERFLOW: auto; WIDTH: 10.599in; POSITION: absolute; TOP: 0.200in; HEIGHT: 9.498in', $

PAGELAYOUT=5, NAME='Page layout 5', text='Purchase Order Listing By Date',  TOC-LEVEL=1, ORIENTATION=LANDSCAPE, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report5', TEXT='report5', TOC-LEVEL=0, POSITION=(0.480 0.200), DIMENSION=(10.599 9.498), METADATA='Z-INDEX: 104; LEFT: 0.480in; OVERFLOW: auto; WIDTH: 10.599in; POSITION: absolute; TOP: 0.200in; HEIGHT: 9.498in', $

PAGELAYOUT=6, NAME='Page layout 6', text='Purchase Order Listing By Department',  TOC-LEVEL=1, ORIENTATION=LANDSCAPE, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report6', TEXT='report6', TOC-LEVEL=0, POSITION=(0.480 0.200), DIMENSION=(10.599 9.498), METADATA='Z-INDEX: 105; LEFT: 0.480in; OVERFLOW: auto; WIDTH: 10.599in; POSITION: absolute; TOP: 0.200in; HEIGHT: 9.498in', $

PAGELAYOUT=7, NAME='Page layout 7', text='Purchase Order Listing By Vendor',  TOC-LEVEL=1, ORIENTATION=LANDSCAPE, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report7', TEXT='report7', TOC-LEVEL=0, POSITION=(0.480 0.200), DIMENSION=(10.599 9.498), METADATA='Z-INDEX: 106; LEFT: 0.480in; OVERFLOW: auto; WIDTH: 10.599in; POSITION: absolute; TOP: 0.200in; HEIGHT: 9.498in', $

PAGELAYOUT=8, NAME='Page layout 8', text='Alphabetic Listing By Vendor',  TOC-LEVEL=1, ORIENTATION=LANDSCAPE, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report8', TEXT='report8', TOC-LEVEL=0, POSITION=(0.480 0.200), DIMENSION=(10.599 9.498), METADATA='Z-INDEX: 107; LEFT: 0.480in; OVERFLOW: auto; WIDTH: 10.599in; POSITION: relative; TOP: 0.200in; HEIGHT: 9.498in', $

PAGELAYOUT=9, NAME='Page layout 9', text='Geographical Summary',  TOC-LEVEL=1, ORIENTATION=LANDSCAPE, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report9', TEXT='report9', TOC-LEVEL=0, POSITION=(0.480 0.200), DIMENSION=(10.599 9.498), METADATA='Z-INDEX: 108; LEFT: 0.480in; OVERFLOW: auto; WIDTH: 10.599in; POSITION: absolute; TOP: 0.200in; HEIGHT: 9.498in', $

PAGELAYOUT=10, NAME='Page layout 10',text='Geographical Detail',  TOC-LEVEL=1, ORIENTATION=LANDSCAPE, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0.50,RIGHTMARGIN=0.25,', $
COMPONENT='report10', TEXT='report10',TOC-LEVEL=0, POSITION=(0.480 0.200), DIMENSION=(10.599 9.498), METADATA='Z-INDEX: 108; LEFT: 0.480in; OVERFLOW: auto; WIDTH: 10.599in; POSITION: absolute; TOP: 0.200in; HEIGHT: 9.498in', $

END
-IF &FMT EQ 'EXL2K' GOTO SKIP_COMP1;
SET COMPONENT='report1'
-*component_type report
-INCLUDE fin_pdis_01
-SKIP_COMP1
SET COMPONENT='report2'
-INCLUDE fin_pdis_02
SET COMPONENT='report3'
-INCLUDE fin_pdis_03
SET COMPONENT='report4'
-INCLUDE fin_pdis_04
SET COMPONENT='report5'
-INCLUDE fin_pdis_05
SET COMPONENT='report6'
-INCLUDE fin_pdis_06
SET COMPONENT='report7'
-INCLUDE fin_pdis_07
SET COMPONENT='report8'
-INCLUDE fin_pdis_08
SET COMPONENT='report9'
-INCLUDE fin_pdis_09
SET COMPONENT='report10'
-INCLUDE fin_pdis_10
COMPOUND END




Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
January 11, 2011, 11:18 AM
Michelle Skaggs
Many Thanks Tom, this was exactly what I needed. I'll created a test.fex and work with that in the dev studio, though I'm finding I get better results coding myself.


DevStudio Version 7701
WebFocus 7.7 Windows Server 2003 PDF Format