Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Looped fex inside a compound report document
Go
New
Search
Notify
Tools
Reply
  
[Solved] Looped fex inside a compound report document
 Login/Join
 
Platinum Member
posted
Hi,

I have a PDF report which loops and creates 5 reports one below the other.
When i run the fex individually it works perfect.

My objective is to place that fex in a compound report.So i added a report container in compound report document and referenced the fex.But on running the compound report, i get only the the report from the loop's first value.

Is that how it normally works.?
Does looped report work in a compound report document.?

I see no error at all.

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


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 208 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Expert
posted Hide Post
Are you using COMPOUND OPEN / CLOSE ?

Can you replicate with sample data ? or post your code ?

My first guess is that you have a compound open in you looping fex which causes the issue, but only a guess without code to check.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6124 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
In my looping fex i am using OPEN and CLOSE.
I will replicate using sample data and post.


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 208 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi,

Here is the fex code which has looping in it.


  
-SET &ECHO='ALL';
-SET &SLNO=1;
-DEFAULT &START_DATE = '2012/01/03'
-DEFAULT &END_DATE = '2012/02/25'
TABLE FILE wf_retail
PRINT
DST.WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_SUBCATEG
ON TABLE HOLD AS TEST FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END

-SET MAXCNT = &LINES;
-TYPE MAXCOUNT IS &MAXCNT
-SET &PRODUCT_SUBCATEG = '';


-REPEAT :end_read &MAXCNT TIMES
-READFILE TEST
-SET &PSUB = &PRODUCT_SUBCATEG;
-TYPE SLNO = &SLNO
-SET &HOLDNAME = 'HLD'|EDIT(&SLNO);
-TYPE HOLDNAME = &HOLDNAME
-SET &SC = &PSUB;
-TYPE &SC

-*-EXIT

TABLE FILE wf_retail
SUM WF_RETAIL.WF_RETAIL_SALES.COGS_LOCAL
	WF_RETAIL.WF_RETAIL_SALES.GROSS_PROFIT_US
	WF_RETAIL.WF_RETAIL_SALES.REVENUE_US
BY WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_SUBCATEG 
WHERE WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE GE &START_DATE.(|FORMAT=YYMD).Date:.QUOTEDSTRING;
WHERE WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE LE &END_DATE.(|FORMAT=YYMD).Date:.QUOTEDSTRING;
WHERE WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_SUBCATEG EQ '&SC'
ON TABLE HOLD AS &HOLDNAME
END

-SET &PDFFOR = IF &SLNO EQ '1' THEN 'OPEN NOBREAK' ELSE IF &SLNO EQ &MAXCNT THEN 'CLOSE' ELSE 'NOBREAK';

-SET &SLNO = &SLNO+1;
-IF &SLNO GT MAXCNT THEN GOTO LOOPEND;



TABLE FILE &HOLDNAME
SUM COGS_LOCAL
	GROSS_PROFIT_US
	REVENUE_US
BY PRODUCT_SUBCATEG 
ON TABLE PCHOLD FORMAT PDF &PDFFOR
ON TABLE SET STYLE *
     UNITS=IN,
    SQUEEZE=ON,
     ORIENTATION=LANDSCAPE,
$
ENDSTYLE
END

-:end_read
-GOTO LOOPEND
-TYPE "Done"
-LOOPEND
-EXIT

I am using OPEN NOBREAK and CLOSE for the first and last iteration and NOBREAK inbetween.

This fex when i use in a compound report document,i get only the report output corresponding to the first iteration value in the loop.


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 208 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I have seen some post regarding SET COMPOUND = OPEN and close.In my compound report i add the loop fex to compound report using GU and i don't see any such code generated.


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 208 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Gold member
posted Hide Post
srajeevan, The code you posted is producing a compound PDF without output for most subcategories for me.

- Rob


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
 
Posts: 86 | Location: MI | Registered: July 23, 2009Reply With QuoteReport This Post
Expert
posted Hide Post
And whats in the wrapper fex ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6124 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
@Rob..I get output from the code i posted.I tested it ryt now.
It is just a single line output for each sub category.
There are around 14 subcategories though.
Te same report when i reference in a compound PDF gives only first subcategory output.


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 208 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Platinum Member
posted Hide Post
@Waz.

I just reference this fex in a compound report chart container using GUI.Here is the code for that.

  
 -* Default Mode: ResourceLayout
SET HTMLARCHIVE=ON
*-HOLD_SOURCE
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='prop_with_names^Margins_Left=0.5^Margins_Top=0.5^Margins_Right=0.5^Margins_Bottom=0.5^thumbnailscale=4', MERGE=ON, ORIENTATION=LANDSCAPE, PAGESIZE=10 x 14, SHOW_GLOBALFILTER=OFF,PAGENUM-RESET=ONMERGE, $
PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', 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=2, POSITION=(0.479 1.458), DIMENSION=(* *), BYTOC=0,  ARREPORTSIZE=DIMENSION, METADATA='left: 0.479in; top: 1.458in; width: 8.307in; height: 3.125in; position: absolute; z-index: 1;', $
END
SET COMPONENT='report1'
-*component_type report
-INCLUDE IBFS:/WFC/Repository/Apps/Test/procedure/Loop_Multi_Report_Demo.fex
COMPOUND END


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 208 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Expert
posted Hide Post
Hi srajeevan,

So you are wrapping your compound report in a compound report.

I had a similar situation last year and when I asked TechSupport, they responded with "We will not be supporting a compound report in a compound report".

What was the reason for creating the wrapper ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6124 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I see no indication that the inner reports are compound reports themselves.

I'm pretty sure that the reason you are only seeing the output of the first loop iteration is that you write all your reports into the same compound report COMPONENT.

You need to create a new COMPONENT for each report in the compound report, each with its own unique name. You also need to define each component in the PAGELAYOUT declaration.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1646 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
@Waz:
I have this requirement where i have to take a compound report(with multiple reports) which accepts a filter(say PROD SUBCATEGORY) and generate reports.
Till now it takes one single values are generate compound report.But now the requirement changed and the compound report should produce reports with all values.
I can manually do this,but looping would have been perfect if compound report supported it.


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 208 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Platinum Member
posted Hide Post
@Wep5622.

The code i posted above is the fex which loops and i am placing that fex inside compound report component.
I understand that i need to create a new component.But since i am doing the looping and it is dynamic ,i cannot create fixed number of components since the number of iterations in the loop can vary according to data.

I think ,if i create individual component and place my report here,it is same as manually adding report into the compound report for each iteration.

I am thinking of a way to add a new component dynamically if my looping fex needs.I am not sure if that is possible.

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


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 208 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Expert
posted Hide Post
I think you can do this by getting the number of loops as you do above, then create the compound layout.

e.g.
TABLE FILE wf_retail
PRINT
DST.WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_SUBCATEG
ON TABLE HOLD AS TEST FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END

-SET MAXCNT = &LINES;

-* Default Mode: ResourceLayout
SET HTMLARCHIVE=ON
*-HOLD_SOURCE
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='prop_with_names^Margins_Left=0.5^Margins_Top=0.5^Margins_Right=0.5^Margins_Bottom=0.5^thumbnailscale=4', MERGE=ON, ORIENTATION=LANDSCAPE, PAGESIZE=10 x 14, SHOW_GLOBALFILTER=OFF,PAGENUM-RESET=ONMERGE, $
PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $

-REPEAT :set_rpt FOR &Cntr FROM 1 TO &MAXCNT ;
COMPONENT='report&Cntr', TEXT='report&Cntr', TOC-LEVEL=2, POSITION=(0.479 1.458), DIMENSION=(* *), BYTOC=0,  ARREPORTSIZE=DIMENSION, METADATA='left: 0.479in; top: 1.458in; width: 8.307in; height: 3.125in; position: absolute; z-index: 1;', $
:set_rpt

END


-REPEAT :end_read FOR &Cntr FROM 1 TO &MAXCNT ;
-READFILE TEST
-SET &PSUB = &PRODUCT_SUBCATEG;
-TYPE SLNO = &SLNO
-SET &HOLDNAME = 'HLD'|EDIT(&SLNO);
-TYPE HOLDNAME = &HOLDNAME
-SET &SC = &PSUB;
-TYPE &SC

-*-EXIT

TABLE FILE wf_retail
SUM WF_RETAIL.WF_RETAIL_SALES.COGS_LOCAL
	WF_RETAIL.WF_RETAIL_SALES.GROSS_PROFIT_US
	WF_RETAIL.WF_RETAIL_SALES.REVENUE_US
BY WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_SUBCATEG 
WHERE WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE GE &START_DATE.(|FORMAT=YYMD).Date:.QUOTEDSTRING;
WHERE WF_RETAIL.WF_RETAIL_TIME_SALES.TIME_DATE LE &END_DATE.(|FORMAT=YYMD).Date:.QUOTEDSTRING;
WHERE WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_SUBCATEG EQ '&SC'
ON TABLE HOLD AS &HOLDNAME
END

-SET &SLNO = &SLNO+1;
-IF &SLNO GT MAXCNT THEN GOTO LOOPEND;


SET COMPONENT='report&Cntr'
-*component_type report

TABLE FILE &HOLDNAME
SUM COGS_LOCAL
	GROSS_PROFIT_US
	REVENUE_US
BY PRODUCT_SUBCATEG 
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
     UNITS=IN,
    SQUEEZE=ON,
     ORIENTATION=LANDSCAPE,
$
ENDSTYLE
END

-:end_read
-GOTO LOOPEND
-TYPE "Done"


COMPOUND END



Note. you will need to play with the layout part to replicate the nobreaks


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6124 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Just what I meant, Waz.

That should put each report on a new page (are we missing a page-break statement here?).

Alternatively, you can also use asterisks in the POSITION attribute of the component and add attributes for relative positioning; RELATIVE-TO and such.

I seem to recall that I actually outlined how to do that in an earlier Focalpoint post on relative positioning.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1646 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Thanks all of you.
I am working on implementing the solution given by Waz,Wep5622


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 208 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Looped fex inside a compound report document

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.