Focal Point
[SOLVED] Setting HTMLCSS on is not working.

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

August 20, 2012, 11:32 AM
J.Hines
[SOLVED] Setting HTMLCSS on is not working.
Hi,
I'm new to WF report dev, but have looked all over the forum and internal documentation without finding a good answer, so thought I'd ask here.

I'm developing reports for AHTML and trying to style them as I want.
My first question, and I think it's simple, is that no matter whether I set HTMLCSS on or off (either with a SET above the report, or with ON TABLE), the resulting HTML report has inline styles for every single cell. How do I get it to do what the documentation says it should do, which is have an internal style sheet?
My report's style command for my WF stylesheet is:

ON TABLE SET STYLE *
INCLUDE = customstyle,
$

Second question: I can't seem to get borders to show. If it turn GRID on, it shows ugly fat default borders, even if I set other borders in the stylesheet. If I turn GRID off, no borders show when the report runs, even though it does show in ReportPainter.

This message has been edited. Last edited by: J.Hines,



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
August 20, 2012, 12:43 PM
J.Hines
I think I found the answer to both questions, and it's that the AHTML format, for whatever unknown reason, won't do borders, won't pay attention to HTMLCSS ON, and probably other differences. HTML allows me to style it as I wish, but then of course I don't have all the active sorting options and whatnot.

Anyone have any idea why AHTML was implemented so differently than HTML when it's still HTML code? Was this holdover from when it AHTML used to be flash? Does this nonsense change in WF 8?



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
August 21, 2012, 02:03 PM
Francis Mariani
I can't answer your questions about AHTML, but this may solve your grid problem - use the CSS border-collapse property:

TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY CAR
BY MODEL

ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT AHTML
ON TABLE SET STYLE *

INCLUDE=endeflt,$

TYPE=REPORT, GRID=ON, $

ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<style type="text/css">
table { border-collapse: collapse; }
</style>
-HTMLFORM END



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
August 24, 2012, 12:20 PM
J.Hines
Thanks Francis, that at least works for any single report. Do you know any way I can put this into a .sty stylesheet? I have around 50 reports, I want to use just a single stylesheet that I can easily change rather than putting styling code for every procedure.

I've been looking through posts for "collapse" and saw an earlier one of yours on a similar question, and I'm going for what you had asked, which is how to accomplish with internal stylesheets? If I have GRID=ON, then it doesn't seem to matter what I put for the width for borders; LIGHT, 1, or 0.5, nothing collapses the borders.

It just seems silly frankly that you can apply a set of styles common-sensically with the HTML format, but you have to do these kind of hacks to get the similar results in AHTML.

This message has been edited. Last edited by: J.Hines,



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
August 24, 2012, 02:03 PM
Francis Mariani
I stick it in an INCLUDE, along with other stuff I want to see on a page.


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
August 24, 2012, 02:46 PM
J.Hines
SOLVED IT!

As mentioned, I already have about 50 reports, and they already had an include for a WebFOCUS stylesheet, so I didn't want to have to go back and add another INCLUDE. The solution is to create a regular CSS stylesheet and put it somewhere in your app folder or app path, and then in the WebFOCUS stylesheet, use
CSSURL=styles.css  

Just replace with the name of your stylesheet and you have both an internal and external stylesheet using just a single INCLUDE.

Thanks!



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.
August 24, 2012, 02:55 PM
Francis Mariani
Very nice! I like this solution.

TYPE=REPORT, CSSURL=/approot/app1/style1.css, $



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