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?
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
-*
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...
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