Jump to content

Having difficulties displaying an image in the subhead when ...


Todd Van Valkenburg

Recommended Posts

Having difficulties displaying an image in the subhead when the output type is set to PDF (crashes reporting server agent). But when I switch the output type to HTML, then it works.

Here is the output when running with HTML (the image is the square in the body and subhead):

 

image.png355624 12.4 KB

 

And here is the fex that works with HTML but not PDF.

 

SET KEEPDEFINES=ON

-*COMPONENT=Define_car

DEFINE FILE ibisamp/car

square_image/A20V=square_22.png ;

END

ENGINE INT CACHE SET ON

SET PAGE-NUM=NOLEAD

SET SQUEEZE=ON

-DEFAULTH &WF_HTMLENCODE=ON;

SET HTMLENCODE=&WF_HTMLENCODE

SET HTMLCSS=ON

-DEFAULTH &WF_EMPTYREPORT=ON;

SET EMPTYREPORT=&WF_EMPTYREPORT

-DEFAULTH &WF_SUMMARY=Summary;

-DEFAULTH &WF_TITLE=WebFOCUS Report;

TABLE FILE ibisamp/car

BY CAR.ORIGIN.COUNTRY NOPRINT

ON CAR.ORIGIN.COUNTRY SUBHEAD

Line1. Start subhead. Country is: <COUNTRY

Line2. Insert image next: <square_image

Line3. End of subhead.

BY square_image AS

BY CAR.COMP.CAR

BY CAR.CARREC.MODEL

ON TABLE PCHOLD FORMAT HTML

ON TABLE NOTOTAL

ON TABLE SET CACHELINES 100

ON TABLE SET GRWIDTH 1

ON TABLE SET KEEPDEFINES ON

ON TABLE SET BYDISPLAY ON

ON TABLE SET STYLE *

INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$

TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, SUMMARY=&WF_SUMMARY.QUOTEDSTRING, $

TYPE=DATA, COLUMN=square_image, IMAGE=IBFS:/WFC/Repository/ReportWriters/subhead_test/square_22.png, SIZE=(0.120000 0.120000), $

TYPE=SUBHEAD, BY=CAR.COMP.CAR, LINE=1, JUSTIFY=LEFT, $

TYPE=SUBHEAD, BY=CAR.COMP.CAR, LINE=1, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=BOLD, $

TYPE=SUBHEAD, BY=CAR.COMP.CAR, LINE=2, JUSTIFY=LEFT, $

TYPE=SUBHEAD, BY=CAR.COMP.CAR, LINE=2, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=BOLD, $

TYPE=SUBHEAD, BY=CAR.COMP.CAR, LINE=3, JUSTIFY=LEFT, $

TYPE=SUBHEAD, BY=CAR.COMP.CAR, LINE=4, JUSTIFY=LEFT, $

TYPE=SUBHEAD, BY=CAR.COMP.CAR, LINE=4, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=BOLD, $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=1, JUSTIFY=LEFT, $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=1, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=NORMAL, $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=1, ITEM=1, OBJECT=FIELD, SIZE=10, STYLE=NORMAL, $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=2, JUSTIFY=LEFT, $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=2, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=NORMAL, $

-*original: TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=2, ITEM=1, OBJECT=FIELD, SIZE=10, STYLE=NORMAL, $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=2, ITEM=1, OBJECT=FIELD, IMAGE=IBFS:/WFC/Repository/ReportWriters/subhead_test/square_22.png, SIZE=(0.120000 0.120000), $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=3, JUSTIFY=LEFT, $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=3, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=NORMAL, $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=4, JUSTIFY=LEFT, $

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, LINE=4, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=BOLD, $

ENDSTYLE

END

-RUN

 

Probably something simple that I am missing but I have been wrestling with it for a while and not sure how to make this simple report work with PDF output type.

Thanks!

Link to comment
Share on other sites

Here a sample where image are displayed in HTML or PDF according to selected format.

no choice to test the format and act accordingly

-DEFAULTH &WFFMT = 'HTML'

DEFINE FILE CAR

DOTRED /A150 = IF '&WFFMT.EVAL' EQ 'HTML' THEN '<IMG SRC="/ibi_apps/run/ibfsIBFS_path=EDA/EDASERVE/logo_img/dot_red.gif">' ELSE 'logo_img/dot_red.gif';

DOTBLUE /A150 = IF '&WFFMT.EVAL' EQ 'HTML' THEN '<IMG SRC="/ibi_apps/run/ibfsIBFS_path=EDA/EDASERVE/logo_img/dot_blue.gif">' ELSE 'logo_img/dot_blue.gif';

END

TABLE FILE CAR

SUM SEATS

COMPUTE IMG /A150 = IF SEATS GT 3 THEN 'logo_img/dot_blue.gif' ELSE 'logo_img/dot_red.gif'; AS ''

RCOST

DOTRED NOPRINT

DOTBLUE NOPRINT

BY COUNTRY

ON COUNTRY SUBHEAD

""

BY CAR

BY MODEL

 

-IF &WFFMT EQ 'PDF' THEN GOTO PDFHD;

HEADING

"HTML Output"

"<DOTRED Less or equal to 3 seats"

"<DOTBLUE Greater than 3 seats"

-GOTO NOLEGEND

 

-PDFHD

HEADING

"PDF Output"

" <+0>Less or equal to 3 seats"

" <+0>Greater than 3 seats"

-NOLEGEND

 

ON TABLE PCHOLD FORMAT &WFFMT

ON TABLE SET PAGE-NUM OFF

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,

$

UNITS=IN,

PAGECOLOR='WHITE',

PAGESIZE='Letter',

SQUEEZE=ON,

LEFTMARGIN=0.25,

RIGHTMARGIN=0.25,

TOPMARGIN=0.0,

BOTTOMMARGIN=0.0,

ORIENTATION=LANDSCAPE,

$

TYPE=HEADING,

SIZE=9,

JUSTIFY=LEFT,

$

-IF &WFFMT EQ 'HTML' THEN GOTO HTMLLEGENDSTYL;

TYPE=HEADING,

IMAGE=IBFS:/EDA/EDASERVE/logo_img/dot_red.gif,

POSITION=(0.0 0.25),

SIZE=(0.13 0.14),

$

TYPE=HEADING,

IMAGE=IBFS:/EDA/EDASERVE/logo_img/dot_blue.gif,

POSITION=(0.0 0.40),

SIZE=(0.13 0.14),

$

TYPE=HEADING,

LINE=2,

OBJECT=TEXT,

ITEM=1,

WIDTH=.25,

JUSTIFY=LEFT,

SIZE=8,

$

TYPE=HEADING,

LINE=2,

OBJECT=FIELD,

ITEM=1,

WIDTH=3,

JUSTIFY=LEFT,

SIZE=8,

$

TYPE=HEADING,

LINE=3,

OBJECT=TEXT,

ITEM=1,

WIDTH=0.25,

JUSTIFY=LEFT,

SIZE=8,

$

TYPE=HEADING,

LINE=3,

OBJECT=FIELD,

ITEM=1,

WIDTH=3,

JUSTIFY=LEFT,

SIZE=8,

$

-HTMLLEGENDSTYL

TYPE=DATA,

COLUMN=IMG,

JUSTIFY=CENTER,

IMAGE=(IMG),

POSITION=(0.01 .002),

SIZE=(0.1 0.1),

$

TYPE=SUBHEAD,

IMAGE='dot_orange.gif',

POSITION=(0.01 0.02),

SIZE=(0.1 0.1),

$

ENDSTYLE

END

Link to comment
Share on other sites

Thanks Waz. That was indeed part of the issue with pdfs; I uploaded the image to the proper folder on the reporting server.

So from my experimentation, I am finding that the syntax/method is different when referencing images on BY fields versus in a SUBHEAD.

For BY fields, the placement of the image is controlled by the placement of the field.

TYPE=DATA, COLUMN=square_image, SIZE=(0.12 0.12), IMAGE=square_22.png, $

But for SUBHEAD fields, however, the placement of the image is controlled by POSITION in the stylesheet. Perhaps there is another (better) way but this way worked:

TYPE=SUBHEAD, BY=CAR.ORIGIN.COUNTRY, IMAGE=square_22.png, SIZE=(0.12 0.12), POSITION=(1.6 .28), $

It would be nice if it used the same methodology as the BY field and you could place a <field in the SUBHEAD where you want it as shown in the original fex. This would be more flexible if you have other fields next to the image and you want the image to move in relation to the field width. Or am I missing the proper syntax in the SUBHEAD

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...