Focal Point
[CLOSED] Center Data on Panel

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

April 18, 2019, 06:36 PM
Aaron Palacios
[CLOSED] Center Data on Panel
I working on building a simple 2x2 responsive page on a portal with global filters. Three of the panels are populated with charts and the fourth is populated with a single percentage.

In order to display the single percentage, I created a report with a single column that computes the percentage I want to display. On the report, I formatted the data and title of the column to be center-justified. However, when I added the report to the portal, the report runs and the percentage is showing as left-justified. My assumption is that the 'center-justified' formatting was just for that one column and did not provide the necessary instruction to center justify the report within the panel.

How can I center my report inside the panel?

Thanks

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.1.05
Developer/Power User
Windows, All Outputs
April 19, 2019, 06:09 PM
vaayu
Do you have any screenshots or code to show the issue?


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
April 19, 2019, 06:22 PM
Aaron Palacios
I originally went with this as the style code:

TYPE=HEADING, LINE=1, SIZE=10, STYLE=-BOLD,$
TYPE=DATA,
COLUMN=N1,
BORDER-TOP=OFF,
BORDER-BOTTOM=OFF,
BORDER-LEFT=OFF,
BORDER-RIGHT=OFF,
SIZE=48,
JUSTIFY=CENTER,
$
ENDSTYLE
END

Then I copied this script from another piece of code that a consultant worked on for us

-RUN
-HTMLFORM BEGIN
<script>
var table_array = document.getElementsByTagName("table");
table_array[0].style.margin = "auto";

-HTMLFORM END

The script worked in centering the data when I report the report by itself. However, when I add the report as a resource to my portal, the data still shows left-justified.


WebFOCUS 8.1.05
Developer/Power User
Windows, All Outputs
April 22, 2019, 12:13 PM
Doug
try this freebie:

TABLE FILE...
ON TABLE HOLD AS MYREPORT FORMAT HTMTABLE
...
END
-HTMLFORM BEGIN
<TABLE WIDTH=100%><TR><TD>!IBI.FIL.MYREPORT;</TD></TR></TABLE>
-HTMLFORM END





   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
April 22, 2019, 12:34 PM
David Briars
quote:
...copied this script from another piece of code...

Is not having the closing script tag just a typo within your post, or something you might want to try to add?

The following code...
TABLE FILE CAR
PRINT CAR BY COUNTRY
ON TABLE PCHOLD AS MYREPORT FORMAT HTML
ON TABLE SET PAGE OFF
ON TABLE SET STYLE *
  INCLUDE=IBFS:/WFC/Repository/stylesheets/ENWarm.sty, $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<script>
var table_array = document.getElementsByTagName("table");
table_array[0].style.margin = "auto";
</SCRIPT>
-HTMLFORM END  
...seems to center the report fine in a panel in my BIP:

This message has been edited. Last edited by: David Briars,
April 23, 2019, 10:01 AM
Doug
I don't think the closing script is needed as the script will close, terminate, when the fex completes.
However, it would be better, imho, to including it for clarity.
Also, no scripting is needed in my <table> ... </table> method.