Focal Point
Using Report Painter to report from HOLD file[SOLVED]

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

March 29, 2010, 02:32 PM
T.Peters
Using Report Painter to report from HOLD file[SOLVED]
This is a continuation of the post I made earlier today. After I am able to store a two dates as input parameters, I will use them to run 11 different reports in my procedure stack. The output of each of these reports is a unique HOLD file. I now want to be able to query each of these HOLD files and combine them into a final report that will be displayed on completion of the flow.
What the 11 reports do is builds a small portion of the final, for example:

  Rept 1:
Section     Header                GL Account          Transaction Amt(sum)
---------   ------------------    -----------------   ----------------
REVENUE     Mortgage Insurance    MTG Corp Fees       $1,234,567.89

Rept 2:
Section     Header                GL Account          Transaction Amt(sum)
---------   ------------------    -----------------   ----------------
EXPENSES    Employment and Travel  Hotel Expenses      $2,345,678.90


Final should show:

Section     Header                GL Account          Transaction Amt(sum)
---------   ------------------    -----------------   ----------------
REVENUE     Mortgage Insurance     MTG Corp Fees      $1,234,567.89
EXPENSES    Employment and Travel  Hotel Expenses     $2,345,678.90
                                                      ----------------
                            Total before taxes:       $1,111,111.01 -
                                                      ----------------
                            Total after Taxes:        $999,999,999.00 -
                                                      ================


My problem is that I'm not a FOCUS programmer, so I'm very beholden to the wizards and GUI from Dev Studio to get this done. When I try to build a new report, the only thing I can base the report on are existing physical files in the application I'm developing in. Is there a way I can make the tool recognize the HOLD files I have outputted to and use those as source?

This message has been edited. Last edited by: T.Peters,


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
March 29, 2010, 02:38 PM
GinnyJakes
If you give the hold files different names and you reference them in the same focexec that created them, then you don't have to do anything special to reference them.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
March 29, 2010, 02:52 PM
T.Peters
quote:
Originally posted by GinnyJakes:
If you give the hold files different names and you reference them in the same focexec that created them, then you don't have to do anything special to reference them.


Ginny, thanks again for addressing this. My question really is, is there a way to use the GUI to access the HOLD files? I KIND OF know how to use it by writing code, but I know very very little of FOCUS to get it working.


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
March 29, 2010, 03:13 PM
mrguru
If they have different names then you can reference each file from its unique name. You may have to set a path to where the files are found...


WF 8.2.01M
8.2.01M Reporting Server
Windows 2012 Srvr R2
PDF,Excel, HTML
Graphs - a lot of graphs
March 29, 2010, 03:15 PM
Francis Mariani
If you run all the prior steps, the HOLD files will be included in the table list when you start creating the final report.

The problem is getting the GUI to merge the 11 reports. Through code this is simply using "Universal Concatenation" - the MORE FILE command, unfortunately none of the wizards know about this yet, it's only available in WebFOCUS 7.7 (Universal Concatenation in the Report Painter).

If all 11 hold files have exactly the same field names and field formats, you can add a simple hand-coded step in the procedure viewer to concatenate the files and create one final file that you can use the GUI with. e.g.:

TABLE FILE HOLD01
PRINT *
ON TABLE HOLD AS HOLDAA

MORE
FILE HOLD01
MORE
FILE HOLD02
MORE
FILE HOLD03
MORE
FILE HOLD04
MORE
FILE HOLD05
MORE
FILE HOLD06
MORE
FILE HOLD07
MORE
FILE HOLD08
MORE
FILE HOLD09
MORE
FILE HOLD10
MORE
FILE HOLD11
END


"My problem is that I'm not a FOCUS programmer, so I'm very beholden to the wizards and GUI from Dev Studio to get this done." - You really ought to take a starter course, those wizards aren't all that wizardry.


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
March 29, 2010, 04:14 PM
T.Peters
quote:
You really ought to take a starter course, those wizards aren't all that wizardry.


My friend, I've been asking my mgr(s) to send me to a course for a year or so now. I think we MAY be finally getting approval for that. Like I said, I can kind of stumble my way through the code. I'm much better at reading it and understanding what's going on than trying to write my own. I know COBOL, VB, C++, but never learned FOCUS.

So, if I use the MORE suggestion, how do I access the elements of that report? All of the reports output the same kind of info to the same format. Would I use something like HOLD01.Amount, HOLD02.Amount?


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
March 29, 2010, 04:14 PM
Francis Mariani
Oh well, it looks like you cannot have a MORE in a fex that you want to open in the Procedure Viewer, even if you intend to type the code for that one section.

So, perhaps a Compound Report is what you need.


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
March 29, 2010, 04:28 PM
T.Peters
Francis, I incorporated your suggestion with a minor tweak in it to suit my needs. Unfortunately, I can't get Data Migrator to work right now, so I have no data to test with. I at least got the stack to RUN, though.


WebFOCUS: 7702
O/S : Windows
Data Migrator: 7702
March 29, 2010, 04:43 PM
Francis Mariani
You probably have figured out that you mention only one AMOUNT and the MORE concatenates the data from the rest of the tables.

I am surprised you got the MORE to work if you're stating within the Procedure Viewer...


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
March 29, 2010, 04:44 PM
Waz
I think that I read that MORE will be supported in DS in the next release.

If you are going to do this in DS, then you will have to TABLE and HOLD FORMAT ALPHA the first file.

FILEDEF the first files DDNAME to APPEND, then TABLE SAVE each of the others.

The restriction with this is all fields must be the same format and size.

You should then be able to report of all the data.
TABLE FILE FILE1
PRINT Field2
BY Field1
ON TABLE HOLD AS CFILE1 FORMAT ALPHA
END
FILEDEF CFILE1 DISK cfile1.ftm (APPEND
TABLE FILE FILE2
PRINT Field2
BY Field1
ON TABLE SAVE AS CFILE1
END
TABLE FILE FILEn
PRINT Field2
BY Field1
ON TABLE SAVE AS CFILE1
END
FILEDEF CFILE1 DISK cfile1.ftm
TABLE FILE CFILE1
.
.
.



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 29, 2010, 04:59 PM
Francis Mariani
Nice work around to the impending GUI MORE!


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