Focal Point
Master-Detail report

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

September 28, 2007, 02:45 AM
Seva
Master-Detail report
I need to create Master-Detail report. It should show Master record and Detail records on the same page. HTML format prefered. The data is in SQL tables which I can join on JobID. It should look like this:

- - - Master record
Job_ID| Job_Name
12345 | name here

- - - Detail records
Cost_Code | Cost_Type | Amount
111111111 | 77777777 | 1,234
222222222 | 88888888 | 5,678

How can I do such layout (show Detail records below Master record)?

WebFocus 7.1.6 on WinXP using SQL2005

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


WF 7.6.4, Win XP, SQL 2005
September 28, 2007, 04:22 AM
FrankDutch
Seva

There are more ways to do this and it depends on how you want this to be displayed.

You have to create two separate reports first and then create a compound report that runs the two and displays it as one report.

If the first report in fact is just one line of info (and not a table of several records), you can put that master record also in the header of the detailed report.

This second method would be better if the report would look like

Job_ID| Job_Name
12345 | name here

Cost_Code | Cost_Type | Amount
111111111 | 77777777 | 1,234
222222222 | 88888888 | 5,678

Job_ID| Job_Name
34221 | an other job

Cost_Code | Cost_Type | Amount
122122112 | 82218199 | 5,445
232111123 | 53323127 | 2,678

next job....


to do it this way you can

TABLE FILE CAR
PRINT MODEL
SALES CNT.BODYTYPE
BY COUNTRY NOPRINT
ON COUNTRY SUBHEAD
"country:"
"<COUNTRY"
"------------"
ON COUNTRY SUBTOTAL AS ''
ON COUNTRY SUBFOOT
" "
" "
END





Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

September 28, 2007, 08:29 AM
PBrightwell
TABLE FILE MASTER
PRINT JOB_ID JOB_NAME
OVER COST_CODE COST_TYPE
END


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
September 28, 2007, 08:59 AM
FrankDutch
I'm sorry to say PB, but that does not what Seva is asking for, it just prints a job_id and job_name on one line and on the next line a cost_code and a cost_type.
If these 4 fields are in the same record and there are more records with the same job_id and job_name, these 2 fields are repeating.

BTW would you also update your signature.....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

September 28, 2007, 09:52 AM
Leah
Small example of how I might do it.
  
SET BYDISPLAY = ON 
SET STYLEMODE = FIXED
TABLE FILE CAR
PRINT CAR AS '' SALES  AS '' DEALER_COST AS ''
COMPUTE SOMEFILL/A6 = ' '; AS ''
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON COUNTRY NOSPLIT
ON COUNTRY UNDER-LINE
ON COUNTRY SKIP-LINE
ON COUNTRY SUBHEAD
"Country File"
"<COUNTRY"
" "
"Car        <20>Sales      Dealer Cost"
END



Leah
September 28, 2007, 10:38 AM
FrankDutch
yes what Leah did is better, since now you will get a header above the detailed report.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

September 28, 2007, 12:43 PM
Seva
Thank you. It is almost what I'm looking for, but still not exactly what I need. The report formatting doesn't look good. I wish I can upload files here which have Master and Detail section the way I need them to be formatted. Can I upload files?


WF 7.6.4, Win XP, SQL 2005
September 28, 2007, 12:57 PM
N.Selph
No - If you want more people to help you with your problem, it is better to illustrate your problem with the IBI Sample files, such as the CAR file.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
September 28, 2007, 02:54 PM
Seva
I put the desired layout of report at the following link. You can see 1 Master line for Job Number on the top and 3 Detail lines below. I'd like to have it formatted similar to what you see, including formatting for column headers. How can I do this?
http://svaysband.freeservers.com/module1b_combined.htm
Thanks


WF 7.6.4, Win XP, SQL 2005
September 28, 2007, 06:44 PM
FrankDutch
Seva

your example is clear, it's a compound report.
It can be done the way I described this.

build your two separate reports
create a compound report that includes the two fexes, run the report.

how to create a cmpound report is pointed out several times here. Search for "compound"

And please update your signature or we won't help anymore...




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

September 28, 2007, 07:00 PM
Seva
Thank you for your help. How can I update my signature? What I try to do now is to follow example 'Embedding Reports and Variables Into One HTML Web Page' in WebFocus Developer Studio Online Help: TABLE FILE CAR "REPORT 1 - BY COUNTRY" PRINT CAR MODEL BODYTYPE BY COUNTRY ON TABLE HOLD FORMAT HTMTABLE AS REPORT1 ON TABLE SET STYLE *TYPE=HEADING,STYLE=BOLD,COLOR=RED,$ ENDSTYLE END TABLE FILE CAR "REPORT 2 - BY BODY TYPE" PRINT CAR MODEL COUNTRY BY BODYTYPE ON TABLE HOLD FORMAT HTMTABLE AS REPORT2 ON TABLE SET STYLE * TYPE=HEADING,STYLE=BOLD,COLOR=BLUE,$ ENDSTYLE END TABLE FILE CAR "REPORT 3 - BY MANUFACTURER" PRINT MODEL BODYTYPE COUNTRY BY CAR ON TABLE HOLD FORMAT HTMTABLE AS REPORT3 ON TABLE SET STYLE * TYPE=HEADING,STYLE=BOLD,COLOR=GREEN,$ ENDSTYLE END -HTMLFORM BEGIN !IBI.FIL.REPORT1; !IBI.FIL.REPORT2; !IBI.FIL.REPORT3; -HTMLFORM END However, I'm getting error - UNABLE TO LOCATE END OF !IBI ESCAPE SEQUENCE. Any ideas?


WF 7.6.4, Win XP, SQL 2005
September 30, 2007, 12:18 AM
susannah
Seva, on the top navigation bar on this forum
click GO
then Personal_Zone
then Profile

See the 2nd sticky post at the top of the forum? Open it, and read what our moderator wants us to do.
and then, learn to use the code tags (rightmost button on the top of the Post-A-Reply page) to surround your code, when you paste it in a reply.
ok?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
September 30, 2007, 12:29 PM
Seva
Thank you very much. I made changes to my profile / signature. I hope I did it right.
The latest issue I had is getting error UNABLE TO LOCATE END OF !IBI ESCAPE SEQUENCE when I followed example at 'Embedding Reports and Variables Into One HTML Web Page' in WebFocus Developer Studio Online Help. I was able to figure it out. The original code had at the bottom lines !IBI.FIL.REPORT1;
I used in my code !IBI.FIL.HOLDMASTER; and got error. I changed it to !IBI.FIL.HMASTER; and it works. It looks like there is a limitation - no more than 8 characters allowed in the name.


WF 7.6.4, Win XP, SQL 2005
September 30, 2007, 02:19 PM
FrankDutch
Seva

The signature is as it should be...
If your script is working now that would be great. The 8 characters sounds logic.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7