Focal Point
[CLOSED]Struggling with styling with multiple reports.

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

January 12, 2016, 03:45 PM
Richard P
[CLOSED]Struggling with styling with multiple reports.
Hi, I'm new on the forum and with FOCUS language too... and I'm really about to go crazy with this one...

FYI, I'm using DevStudio 8105 on Unix with Oracle DB.

So..I need to create a 'multiple report' report (on the same page) (for instance: 'North America Sales Summary' and 'Europe Sales Summary').
Ok...don't ask...it's the requirement...It made no sense and I know...

One thing to know, these two reports will always fits on one sheet...it's two really small grid.

I'm almost there... In my .fex, I have written two TABLE FILE

EXAMPLE:

TABLE FILE SALES
HEADING
"North america and Europe sales"
"EXECUTED_BY: blablabla"
"EXECUTED_ON: blablabla"

SUM AMOUNT
BY CLIENT
WHERE REGION EQ 'AM'
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE ROW-TOTAL AS 'Total'
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT HTML AS TAB1
...

ENDSTYLE
END

-* BEGINNING OF THE SECOND REPORT (within the same FEX)

TABLE FILE SALES -*(yes, sales again)
SUM AMOUNT
BY CLIENT
WHERE REGION EQ 'EU'
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE ROW-TOTAL AS 'Total'
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT HTML AS TAB1
...

ENDSTYLE
END

-RUN


END OF THE EXAMPLE:


The problem is:

When I don't apply styling to the reports, everything is fine (well, ugly but the output is ok).
The moment I'm trying to have a header (only on the upper report) or/and a different styling on the first and second report (DATA, HEADERS, TOTALS, ACROSS), everything become a mess.

I've tried the followings without success :

- compound reports
- two different stylesheets

The nearest I came up it's when I reproduce each line of styling in both reports, even if one have an ACROSS and the other don't... For my 10 rows header in the first report, I must have 10 blanks for the second report...I obviously end up with 10 blank lines between the two reports... visually, it's really bad.

how can I have different styling applied on two different report within the same FEX.

Thanks a lot for your help !!

PS:I know it might be unclear so don't hesitate to ask questions

Richard

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


WF 8.0.0.9, Unix, All Outputs
January 12, 2016, 04:16 PM
BabakNYC
Save each report in a separate report. Then create a new Document and insert the two focexecs into the document. That way you'll have one page that contains both reports independent of each other. You can have whatever style you want for each of them.


WebFOCUS 8206, Unix, Windows
January 12, 2016, 04:42 PM
Francis Mariani
In this example, the styling seems to be working for the two reports. What is the specific issue? I can only guess your example doesn't illustrate the problem you see.
SET PAGE-NUM=NOLEAD
-RUN

TABLE FILE CAR
SUM 
SALES

BY CAR
ACROSS WEIGHT

WHERE COUNTRY EQ 'JAPAN'

HEADING
"JAPAN <+0>SALES"

-*ON TABLE ROW-TOTAL AS 'TOTAL'
-*ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT HTML AS TAB1
ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON, FONT='ARIAL',
SIZE=9, BORDER=1, BORDER-COLOR=SILVER,
$
TYPE=HEADING, STYLE=ITALIC, SIZE=10, $
TYPE=HEADING, ITEM=1, COLOR=RED, $
TYPE=TITLE, STYLE=BOLD, COLOR=SILVER, $
TYPE=ACROSSTITLE, STYLE=BOLD, COLOR=SILVER, $
TYPE=GRANDTOTAL, COLOR=RED, $
ENDSTYLE
END
-RUN

TABLE FILE CAR
SUM 
SALES

BY CAR
ACROSS WEIGHT

WHERE COUNTRY EQ 'ENGLAND'

HEADING
"ENGLAND <+0>SALES"

ON TABLE ROW-TOTAL AS 'TOTAL'
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT HTML AS TAB1
ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON, FONT='ARIAL',
SIZE=9, BORDER=1, BORDER-COLOR=SILVER,
$
TYPE=HEADING, STYLE=UNDERLINE, SIZE=10, $
TYPE=HEADING, ITEM=1, COLOR=GREEN, $
TYPE=TITLE, STYLE=BOLD, COLOR=NAVY, $
TYPE=ACROSSTITLE, STYLE=BOLD, COLOR=NAVY, $
TYPE=GRANDTOTAL, COLOR=GREEN, $
ENDSTYLE
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
January 12, 2016, 05:05 PM
Francis Mariani
When you post code, it's best to write code using one of the IBI supplied files, anyone with WebFOCUS can run and debug the code.

I've definitely had problems with styling when outputting two reports, but the example I provided doesn't have the issue. I need to see the code hidden behind the ....


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
January 13, 2016, 05:23 AM
FreSte
When you add ...
  
SET HTMLCSS = ON

... you see the difference.
The heading is now for both reports GREEN

The inline stylesheets are using the same classnames and the last will overide the first.
January 13, 2016, 08:40 AM
Richard P
quote:
Originally posted by BabakNYC:
Save each report in a separate report. Then create a new Document and insert the two focexecs into the document. That way you'll have one page that contains both reports independent of each other. You can have whatever style you want for each of them.


I'm not sure to understand what you meen...I've allready tried to have another procedure with two includes (my two reports) and it doesn't work. And it make sense since include only append the code so I end up with the exact code and the same result. Thanks for your help


WF 8.0.0.9, Unix, All Outputs
January 13, 2016, 09:13 AM
BabakNYC
Create two .fex files with each TABLE FILE code you currently have in one .fex. So you now have Rep1.fex and Rep2.fex.

Then CREATE, NEW, DOCUMENT and insert Rep1 and Rep2 in the document.


WebFOCUS 8206, Unix, Windows
January 13, 2016, 10:20 AM
John_Edwards
I've had the exact same problem. The html stylesheets that are created for both reports use the same IDs, so some of the styling from the first report bleeds into the second. It can be infuriating, as a minor adjustment to the first report can send the second on a bender when they both had worked fine together.

I solved the problem with html iframes. I run each report via a separate focexec, each delivered to its own iframe on a single output page. That is, when the user clicks the Submit button, an html page comes up with two iframes in it, I use the page's onload trigger to execute one focexec in one iframe on the page, execute the other in another iframe. That keeps everything very separate.

It ain't pretty, but it's very dependable.



January 13, 2016, 10:33 AM
Francis Mariani
When posting code, it's a good idea to be precise. There's no mention of HTMLCSS in the original post. As both BabakNYC and John suggest, iframe is the best way to deal with this.


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
January 13, 2016, 05:37 PM
StuBouyer
Richard,

You are taking advantage of quirk in most browsers where they will keep reading HTML content even after a
</html>
.

Your original FEX sends the following code to your browser:

<html>
<head>...</head>
<body>...</body>
</html>
<html>
<head>...</head>
<body>...</body>
</html>

but the way CSS works is that the last reference to an element will override any attributes of the element that has been set earlier in your code - hence "cascading"

As others have mentioned you will need to either code as a document or separate iframes. The document will give you a more freedom for changing report format - try your orignal code in either PDF or XLSX format and you will only see one report displayed.

Cheers

Stu


WebFOCUS 8.2.03 (8.2.06 in testing)
January 18, 2016, 04:13 AM
Rifaz
Thanks John for the suggestion, I had a similar problem very recently but ends up with coding the same styling in both TABLE requests. I will have to give a try using iframes.


-Rifaz

WebFOCUS 7.7.x and 8.x