Focal Point
[SOLVED] compound documents

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

November 14, 2017, 08:40 AM
Geoff Fish
[SOLVED] compound documents
I have a compound document that was created in document composer It contains 30 different reports all set to flowing and all made relative to one another. I want to give the users the option of turning sections of the report on and off. This is so they can print out only those pages which they need, which in certain cases can run as many as 50 pages for all reports together. I assume I will be passing a yes or no parameter but how do I implement that in such away that it turns sections on or off? I could use autoprompt but would prefer to call an HTML page with either radio buttons or check boxes as the users would be less likely to pick an errant selection.

Thanks you guys are always helpful

This message has been edited. Last edited by: FP Mod Chuck,


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
November 16, 2017, 08:50 AM
Geoff Fish
quote:
posted November 14, 2017 08:40 AM
I have a compound document that was created in document composer It contains 30 different reports all set to flowing and all made relative to one another. I want to give the users the option of turning sections of the report on and off. This is so they can print out only those pages which they need, which in certain cases can run as many as 50 pages for all reports together. I assume I will be passing a yes or no parameter but how do I implement that in such away that it turns sections on or off? I could use autoprompt but would prefer to call an HTML page with either radio buttons or check boxes as the users would be less likely to pick an errant selection.



Rare to not get any response. should i restate my problem?


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
November 16, 2017, 09:04 AM
BabakNYC
Unfortunately, I haven't any insight to offer. However, I do wonder what the users are doing with 50 page printouts. That's a lot of trees. Smiler


WebFOCUS 8206, Unix, Windows
November 16, 2017, 09:09 AM
Francis Mariani
I'm not sure how you would do it in the GUI, but in code all it would take is some -IF ... GOTO ... statements.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 16, 2017, 09:29 AM
Francis Mariani
Something like this, of course, not compatible with the GUI. What I've done in the past is to keep one fex GUI compatible, for future mods, and then copy it to another fex, then add Dialogue Manager.

-* File damon_compound1.fex
 
  
-* File Layout_Example
-DEFAULT &P_REP1 = 'YES';
-DEFAULT &P_REP2 = 'YES';
-DEFAULT &P_REP3 = 'YES';

-* Default Mode: ResourceLayout
SET HTMLARCHIVE=ON
COMPOUND LAYOUT PCHOLD FORMAT DHTML
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='.1^.1^.1^.1^4', MERGE=OFF, ORIENTATION=LANDSCAPE, PAGESIZE=Letter, SHOW_GLOBALFILTER=OFF, $
PAGELAYOUT=1, NAME='Layout Example for Francis', text='Extra Unwanted Rows', TOC-LEVEL=1, BOTTOMMARGIN=.1, TOPMARGIN=.1, ORIENTATION=LANDSCAPE, METADATA='BOTTOMMARGIN=.1,TOPMARGIN=.1,LEFTMARGIN=0,RIGHTMARGIN=0,ORIENTATION=LANDSCAPE,', $
OBJECT=STRING, NAME='Description of Problem', TEXT='<B><FONT face="ARIAL "></FONT></B><FONT face="ARIAL ">This is a page containing 3 fex examples. There are now two spacing issues:<BR>1.  The extra lines between the Page Heading and the Table of data.<BR>2. The extra space under the column titles. If you run the FEXs individually, this space does not happen.<BR><BR>Thank you Francis et al.</FONT><B><FONT face="ARIAL "><FONT face="ARIAL "></FONT></FONT></B>', POSITION=(0.135 0.150), MARKUP=ON, WRAP=ON, DIMENSION=(8.000 1.000),  color=RGB(0 0 0),   METADATA='', $
-IF &P_REP1 NE 'YES' GOTO END_COMP1;
COMPONENT='Dealer Cost', TEXT='Dealer Cost', TOC-LEVEL=2, POSITION=(0.150 1.250), DIMENSION=(* *), METADATA='Z-INDEX: 100; LEFT: 0.15in; WIDTH: 3.4in; POSITION: absolute; TOP: 1.25in; HEIGHT: 1.2in', $
-END_COMP1
-IF &P_REP2 NE 'YES' GOTO END_COMP2;
COMPONENT='Retail Cost', TEXT='Retail Cost', TOC-LEVEL=2, POSITION=(0.150 2.500), DIMENSION=(* *), METADATA='Z-INDEX: 100; LEFT: 0.15in; WIDTH: 3.4in; POSITION: absolute; TOP: 2.5in; HEIGHT: 1.2in', $
-END_COMP2
-IF &P_REP3 NE 'YES' GOTO END_COMP3;
COMPONENT='Sales', TEXT='Sales', TOC-LEVEL=2, POSITION=(0.150 3.800), DIMENSION=(3.400 1.200), METADATA='Z-INDEX: 100; LEFT: 0.15in; WIDTH: 3.4in; POSITION: absolute; TOP: 3.8in; HEIGHT: 1.2in', $
-END_COMP3
END
-RUN
-IF &P_REP1 NE 'YES' GOTO END_FEX1;
SET COMPONENT='Dealer Cost'
-*component_type report
-INCLUDE comp1.fex
-END_FEX1
-IF &P_REP2 NE 'YES' GOTO END_FEX2;
SET COMPONENT='Retail Cost'
-*component_type report
-INCLUDE comp2.fex
-END_FEX2
-IF &P_REP3 NE 'YES' GOTO END_FEX3;
SET COMPONENT='Sales'
-*component_type report
-INCLUDE comp3.fex
-END_FEX3
COMPOUND END
-RUN



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 17, 2017, 09:54 AM
SeyedG
In App Studio 8009, I would use a double list control and in the 'settings' property, I would add the name of all 30 reports and set the defaults to whatever number of reports are used most frequently. Then, allow the customer to de-select or select whatever reports they don't want to run/print. Finally, modify the 'WHERE' clause of your reports to run the selected reports.


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
November 20, 2017, 08:42 AM
Geoff Fish
quote:
Originally posted by BabakNYC:
Unfortunately, I haven't any insight to offer. However, I do wonder what the users are doing with 50 page printouts. That's a lot of trees. Smiler


fundraising from very wealthy alumni


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
November 20, 2017, 08:47 AM
Geoff Fish
quote:
Originally posted by SeyedG:
In App Studio 8009, I would use a double list control and in the 'settings' property, I would add the name of all 30 reports and set the defaults to whatever number of reports are used most frequently. Then, allow the customer to de-select or select whatever reports they don't want to run/print. Finally, modify the 'WHERE' clause of your reports to run the selected reports.


I had considered Francis solution as I have done that be fore for single pieces but i actually like the use of the double list more


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
November 20, 2017, 09:16 AM
Francis Mariani
quote:
modify the 'WHERE' clause of your reports to run the selected reports

How does one run specific fexes based on a WHERE statement?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 27, 2017, 08:58 AM
Geoff Fish
yes that is a good question


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
November 29, 2017, 09:20 AM
Geoff Fish
quote:
Originally posted by SeyedG:
In App Studio 8009, I would use a double list control and in the 'settings' property, I would add the name of all 30 reports and set the defaults to whatever number of reports are used most frequently. Then, allow the customer to de-select or select whatever reports they don't want to run/print. Finally, modify the 'WHERE' clause of your reports to run the selected reports.


could you provide a brief example ? of using wheres to control display of reports?


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
November 29, 2017, 09:35 AM
SeyedG
Hi Geoff Fish and Francis,
I am working with IBI to get an answer to your question. I think in the end, we will pass the parameter containing the IDs of all of your 'Selected' reports to a driver program and then in the driver program, do a bit of string manipulation to extract each report ID and then run the corresponding .fex for that report ID. I will post all the steps and script as soon as it is ready.

Seyed


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
November 29, 2017, 09:56 AM
Francis Mariani
Syed, don't forget that the Document Composer is a GUI tool - not friendly towards Dialog Manager.

Also, the Document Composer generated program has two parts - one where SECTIONs and COMPONENTs are defined, and one where the report is INCLUDEded.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 29, 2017, 04:49 PM
SeyedG
Hi Geoff Fish and Francis,
With help from IBI, I got this working. Created a driver program and then created an HTML page containing a double list to run it. I tried this code for 3 reports, but the concept should work for the 30 reports that Geoff Fish needs.

Here is the code for the driver program:
-SET &ECHO=ALL ;
-? &

-SET &STR_LEN = &RPT_ID.LENGTH;
-SET &testString = STRREP(&STR_LEN, &RPT_ID.QUOTEDSTRING, 4, ' OR ',1,',', &STR_LEN,'A&STR_LEN.EVAL');
-SET &testString_LEN = &testString.LENGTH;
-SET &testString2 = TRUNCATE(&testString.QUOTEDSTRING);
-TYPE testString2 Length = &testString2.LENGTH;
-TYPE &testString testString

-SET &STRING = &testString;
-TYPE &STRING
-* If the incoming string is empty or _FOC_NULL, go to the end
-IF &STRING EQ '' OR &STRING EQ '_FOC_NULL' THEN GOTO ALLDONE;

-* Calculate total number of options (by knowing how many characters were removed - 5 per option, in this example)
-SET &OPTCNT = ((&RPT_ID.LENGTH - &testString2.LENGTH)/5)+2;
-TYPE OPTCNT = &OPTCNT;

-**** This section processes each option in the list selected
-* If no options, go to the end
-IF &OPTCNT LT 1 THEN GOTO ALLDONE;
-SET &CURRPROC=0;
-STARTPROCS
-* Set amper for current option
-SET &CURRPROC=&CURRPROC+1;
-* If current option is higher than total options, go to the end
-IF &CURRPROC GT &OPTCNT THEN GOTO ALLDONE;
-* Get the value of the current option
-SET &CURRLBL=GETTOK(&testString2.QUOTEDSTRING, &testString2.LENGTH, &CURRPROC, ',', &testString2.LENGTH, 'A&testString2.LENGTH');

-* Go to the label of the option
-GOTO &CURRLBL.EVAL
-* If there are any errors in the above processing, exit procedure
-EXIT
-**** End of section

-**** Report 1
-RPT01
TABLE FILE CAR
PRINT COUNTRY
END
-RUN
-* After running this option, return to STARTPROCS for additional options
-GOTO STARTPROCS
-**** End of Report 1

-**** Report 2
-RPT02
TABLE FILE CAR
PRINT CAR
END
-RUN
-* After running this option, return to STARTPROCS for additional options
-GOTO STARTPROCS
-**** End of Report 2

-**** Report 3
-RPT03
TABLE FILE CAR
PRINT MODEL
END
-RUN
-* After running this option, return to STARTPROCS for additional options
-GOTO STARTPROCS
-**** End of Report 3

-ALLDONE
-EXIT



Sorry Francis, I couldn't do all of this strictly using GUI. Had to use the editor for this.

Once this was working, I created an HTML page add a form and then added the above .fex as the data source. Added a double list control. Then in the 'Settings' tab for the double list, I added 'RPT01', 'RPT02', and 'RPT03' for each report including their relevant description. Finally, in the 'Section to' box, I dragged and dropped 'RPT_ID'. Then ran this page and it worked. I could select any or all three reports.

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


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
November 29, 2017, 05:04 PM
Francis Mariani
Thanks for your work on this, but I wonder where the Document Composer Compound report code is...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 29, 2017, 05:18 PM
SeyedG
I can't seem to find it in 8009. Last time, I built compound reports, we were on 7.6.

This message has been edited. Last edited by: SeyedG,
November 30, 2017, 09:05 AM
Francis Mariani
WebFOCUS Release 8.0 Versions 10 and 09 > Reporting Tools > Creating Compound Reports With Document Composer


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 30, 2017, 09:29 AM
SeyedG
Got it. Thank you, Francis.


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)