Focal Point
[CLOSED]Right Align image in header(PDF and HTML Reports)

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

August 08, 2019, 11:04 AM
Siva1925
[CLOSED]Right Align image in header(PDF and HTML Reports)
Hi,
I am trying to right align the image in the header to be in right always.
The user will be able to select the number of columns in the report and the format of the report.

The JUSTIFY,IMAGEALIGN doesnt work.
Is there a way to do this.

WF 82

This message has been edited. Last edited by: Siva1925,
August 08, 2019, 01:12 PM
FP Mod Chuck
Siva

Maybe try the TABHEADING and POSITION to align the image to the right


TYPE=TABHEADING,
IMAGE=IBFS:/WFC/Repository/Sandbox/addafan.jpg,
POSITION=(6.000000 0.000000),
$



Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
August 08, 2019, 01:39 PM
Siva1925
I am using TABHEADING but i need the position to be dynamic.
Keeping it 6 puts the image at the end when i have 6 columns.
But when i have more columns it still stays at the same position.
August 08, 2019, 01:41 PM
MartinY
The position can be parametrized to the value you want according to the number of displayed fields

POSITION=(&POSITR 0.000000),



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
August 08, 2019, 01:47 PM
Siva1925
Hi Martin,
Yes it can be parametrized. But isn't there anything to just right align the image.

If i need to parametrize it i will have to do calculate the widths of the columns and do it.
August 08, 2019, 02:42 PM
Hallway
Is this what you are trying to do?
TABLE FILE GGORDER
SUM QUANTITY/D12 AS 'Ordered,Units'
BY PRODUCT_ID AS 'ID'
BY PRODUCT_DESCRIPTION AS 'Product'
BY VENDOR_NAME AS 'Vendor'
BY PACKAGE_TYPE AS 'Packaging'
ON TABLE SUBHEAD
""
HEADING
"1996 - Total Products Ordered"
WHERE DTPART(ORDER_DATE, YEAR) EQ 1996
ON TABLE SET PAGE-NUM OFF
ON TABLE SET HTMLCSS OFF
ON TABLE SET STYLE * 
TYPE=TABHEADING, IMAGE='/ibi_apps/ibi_html/ib_logo.gif', IMAGEALIGN =RIGHT, $ 
ENDSTYLE
END 

You just need to make sure that HTMLCSS is set to OFF (which might mess up your other formatting, unfortunately)




Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
August 08, 2019, 03:32 PM
Siva1925
Thanks Hallway
That worked like a charm.
Is there a way to do the same in a PDF report.
August 12, 2019, 05:13 PM
Hallway
I'm afraid that I don't know much about creating pdf on WebFOCUS. It is too convoluted.

😖

We find it easier to just have the end user print to pdf from a browser if they feel the need to have it as a pdf.


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
August 13, 2019, 08:11 AM
MartinY
quote:
If i need to parametrize it i will have to do calculate the widths of the columns and do it.

Just asking : since you want it as a PDF format and since a sheet of paper is normally 8 1/2 x 11 (either portrait or landscape), no matter the number of column to display on the report, why don't the page heading/footing, logo, etc., are not always the same size and position ?

I understand that it may look better to have the logo/image above the last column, but is that so important in a PDF ? Probably if your asking, but I was just wondering...
Also, it may be part of your requirements to have it on right, but from my pov, I prefer to have the logo top left. That way no need to change its position according to number of displayed fields.

Using PDF format it's sometime a pain since positioning is not reacting the same as with HTML and some features are not available. Reason why I try to keep it as simple as possible such as below sample.
Also, one thing that can be done (which I also use), is to parametrize your styling : IF &WFFMT EQ 'PDF' THEN GOTO PDFFMT ELSE GOTO HTMLFMT;
And you can -INCLUDE a specific fex with either report type styling or have bloc of code according to report format.

-DEFAULTH &WFFMT = 'HTML'

TABLE FILE GGORDER
SUM QUANTITY/D12 AS 'Ordered,Units'
BY PRODUCT_ID AS 'ID'
BY PRODUCT_DESCRIPTION AS 'Product'
BY VENDOR_NAME AS 'Vendor'
BY PACKAGE_TYPE AS 'Packaging'
HEADING
"1996 - Total Products Ordered"
WHERE DTPART(ORDER_DATE, YEAR) EQ 1996
ON TABLE PCHOLD FORMAT &WFFMT
ON TABLE SET PAGE-NUM OFF
ON TABLE SET HTMLCSS OFF
ON TABLE SET STYLE *
     UNITS=IN,
     PAGECOLOR='WHITE',
     PAGESIZE='Letter',
     SQUEEZE=ON,
-IF &WFFMT NE 'PDF' THEN GOTO OTHFMT;
     LEFTMARGIN=0.25,
     RIGHTMARGIN=0.25,
     TOPMARGIN=0.0,
     BOTTOMMARGIN=0.0,
     ORIENTATION=PORTRAIT,
-GOTO ENDFMT
-OTHFMT
     LEFTMARGIN=0.0,
     RIGHTMARGIN=0.0,
     TOPMARGIN=0.0,
     BOTTOMMARGIN=0.0,
-ENDFMT
$

-IF &WFFMT EQ 'PDF' THEN GOTO PDFFMT ELSE GOTO HTMLFMT;
-PDFFMT
-INCLUDE <apps>/pdffmt.fex
-GOTO OTHSTYLE
-HTMLFMT
-INCLUDE <apps>/htmlfmt.fex

-OTHSTYLE
TYPE=HEADING,
     BORDER=OFF,
     SIZE=10,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=1,
     SIZE=12,
     STYLE=BOLD,
$
-IF &WFFMT NE 'PDF' THEN GOTO SKIPIMG;
TYPE=REPORT,
     IMAGE='/ibi_apps/ibi_html/ib_logo.gif',
     POSITION=(+0.00 +0.25),
     SIZE=(0.4 0.4),
$
-SKIPIMG
ENDSTYLE
END 



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
August 13, 2019, 01:33 PM
Siva1925
That's what I did at the end.
But i wanted to know is there an option to do it
August 13, 2019, 01:41 PM
MartinY
AFAIK, no.
PDF is much more a fixed format where you need to specify where to place things and most of the features are not as dynamic as they are with HTML or not even available Frowner


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007