Focal Point
How do I create subreports / nested reports?

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

September 30, 2005, 12:54 AM
Robert Billing
How do I create subreports / nested reports?
From my searching, it seems this functionality is not possible. I am hoping someone can prove me wrong.

I understand that subreports are replaced by the drilldown ability, which is fine if the user is at a computer. However, I need a report that can be printed and then 'used' in that form. This may mean walking through a warehouse and checking various items in stock.

For each main row, I want to show a set of details about that item. Then I want to show several lists of information related to that main row. In Access, this is simple subreport functionality.

Thanks in advance.
September 30, 2005, 02:45 AM
susannah
its version 7.? and they call it 'accordion' reports. look at Cyril Joy's post below, titled 'expandable'
September 30, 2005, 07:16 PM
dhagen
There are techniques for doing subreports if the output is pdf. I'm pretty sure that you can do similar stuff in html, but it would be a lot harder!

I can post an example later if you need it.
October 02, 2005, 09:44 PM
Robert Billing
I am currently on version 5.3.3. Can you point me to somewhere I can see some example output from a expandable or accordian report?

dhagen, I would be very keen to see some examples of the techniques you are refering to. I am currently using html output, although it would not be an issue to use pdf.
October 03, 2005, 02:49 AM
dhagen
Here is a quick example. The idea is to run each sub-report as a seperate report, and append the results together in a hold file. It is important to account for all columns in the final report in each extract. You assign a blank to alphas, or zero supress the numerics. In the final report, you can have columns over write one another, because only the sub-report's columns will have values to display.


Here is the source:
 
TABLE FILE GGSALES
SUM
COMPUTE C_SORT/I5 = 1;
UNITS
DOLLARS
BUDUNITS
BUDDOLLARS
COMPUTE C_CAT/A11 = ' ';
COMPUTE C_DOL/I8S = 0;
COMPUTE C_BDOL/I8S = 0;
BY REGION
BY ST
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS MYSUB FORMAT ALPHA
END
FILEDEF MYSUB CLEAR
FILEDEF MYSUB DISK mysub.ftm (APPEND
TABLE FILE GGSALES
SUM
COMPUTE C_ST/A2 = ' ';
COMPUTE C_SORT/I5 = 2;
COMPUTE C_UNITS/I8S =0;
COMPUTE C_DOLLARS/I8S =0;
COMPUTE C_BUDUNITS/I8S =0;
COMPUTE C_BUDDOLLARS/I8S =0;
COMPUTE C_CAT/A11 = MAX.CATEGORY;
COMPUTE C_DOL/I8S = DOLLARS;
COMPUTE C_BDOL/I8S = BUDDOLLARS;
BY REGION
BY CATEGORY NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS MYSUB FORMAT ALPHA
END

TABLE FILE MYSUB
PRINT
C_UNITS IN 20 AS ''
C_DOLLARS AS ''
C_BUDUNITS AS ''
C_BUDDOLLARS AS ''
C_CAT IN 15 AS ''
C_DOL IN 25 AS ''
C_BDOL IN 35 AS ''
BY REGION AS ''
BY C_SORT NOPRINT
BY C_ST AS ''
ON REGION SUBHEAD
" "
"Region<12>State<23>Units<30>Dollars<40>Bud Units<50>Bud Dollars"
ON C_SORT SUBHEAD
" "
"<15>Category:<26>Actuals<36>Budgets"
WHEN C_SORT EQ 2;
ON C_SORT SUBFOOT
" "
WHEN C_SORT EQ 2;
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET STYLE *
TYPE=SUBHEAD, LINE=2, STYLE=BOLD+UNDERLINE, $
ENDSTYLE
END
Below is what the hold file would look like before the final report:
  
REGION C_ST C_SORT C_UNITS C_DOLLARS C_BUDUNITS C_BUDDOLLARS C_CAT C_DOL C_BDOL
------ ---- ------ ------- --------- ---------- ------------ ----- ----- ------
Midwest IL 1 307581 3924401 310071 3866856
Midwest MO 1 297727 3761286 297081 3646838
Midwest TX 1 299737 3714978 299955 3680679
Northeast CT 1 302440 3782049 301367 3832202
Northeast MA 1 301909 3707986 301605 3818397
Northeast NY 1 312326 3902265 311387 3926322
Southeast FL 1 310302 3923215 311983 3870405
Southeast GA 1 330283 4100107 334645 4247587
Southeast TN 1 294647 3687057 295619 3689979
West CA 1 610570 7642261 610362 7586347
West WA 1 321469 4010685 320419 4055166
Midwest 2 Coffee 4178513 4086032
Midwest 2 Food 4338271 4220721
Midwest 2 Gifts 2883881 2887620
Northeast 2 Coffee 4164017 4252462
Northeast 2 Food 4379994 4453907
Northeast 2 Gifts 2848289 2870552
Southeast 2 Coffee 4415408 4431429
Southeast 2 Food 4308731 4409288
Southeast 2 Gifts 2986240 2967254
West 2 Coffee 4473517 4523963
West 2 Food 4202337 4183244
West 2 Gifts 2977092 2934306
Hope this helps.

This message has been edited. Last edited by: <Maryellen>,


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott