Jump to content

Im hoping this is an easy one for someone. All Im looking ...


Ben Maxwell

Recommended Posts

Hi Benjamin

I thought it was possible to reference an image in the repository but have not been successful. In your image you have the Domains folder open and not the Data Servers and that is where I can put an image and reference it in a compute in a report built under a Domain. This is assuming your web server and reporting server are on the same machine, if not then you will need to put the image under the Web Applications folders

 

image.png20241116 173 KB

Link to comment
Share on other sites

This may be better than using a Compute because it works for both HTML and PDF. I think I got this coding from App Studio Report Canvas.

TABLE FILE GGSALES

SUM

UNITS

BY CATEGORY

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

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

$

TYPE=REPORT,

IMAGE=IBFS:/WFC/Repository/Public/search.png,

POSITION=(2.000000 2.000000),

$

TYPE=REPORT,

IMAGE=IBFS:/WFC/Repository/Public/chevronred.png,

POSITION=(2.500000 2.500000),

$

ENDSTYLE

END

Link to comment
Share on other sites

You can dynamically include images, like so:

DEFINE FILE GGSALES

CATEGORY_IMG/A30 = CATEGORY || .png;

END

TABLE FILE GGSALES

SUM

UNITS

COMPUTE IMAGE/A1 = ';

BY CATEGORY

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

-*ON TABLE PCHOLD FORMAT XLSX

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

$

TYPE=DATA, COLUMN=IMAGE,

IMAGE=IBFS:/WFC/Repository/Public/( CATEGORY_IMG ),

$

ENDSTYLE

END

Link to comment
Share on other sites

I am going to view this as attempt #1 and then I will work my way through the other suggestions.

I tried using this code to return a simply red dot :

 

Is there anything wrong i my code

Can this possible be a permissions issue

 

TABLE FILE CAR

PRINT

COMPUTE TrafficLight/A200 = ;

BY LOWEST CAR.ORIGIN.COUNTRY

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

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

$

ENDSTYLE

END

Location of png file :

 

When running it I get this

Link to comment
Share on other sites

Benjamin

If you code said /approot/images/red_dot.png then that is correct. If the web server is on a different machine than the reporting server that that is probably why it couldnt find it. You would need to put the image under the Web Applications folder which you would have to expose on App Studio.

 

image.png25601444 299 KB

 

I dont think it is permissions but on the Reporting Server console you can right mouse click on the images folder and choose properties and look at the File Access Options

Link to comment
Share on other sites

The following code worked for me in HTML, AHTML, PDF, and XLSX formats. If the images/folder is on the APP PATH, then you dont need the images/ in the Compute.

TABLE FILE ibisamp/ggsales

PRINT UNITS

DOLLARS

COMPUTE Image/A30 = IF UNITS LE 1600

THEN 'images/red_dot.png'

ELSE 'images/green_dot.png';

AS 'Traffic,Light'

BY CATEGORY

WHERE SEQ_NO LE 9

ON TABLE SET PAGE NOLEAD

ON TABLE PCHOLD FORMAT &WFFMT.(<HTML>,<AHTML>,<PDF>,<XLSX>).

ON TABLE SET STYLE *

TYPE=REPORT, BORDER=LIGHT, $

TYPE=TITLE, COLOR=WHITE, BACKCOLOR=SILVER, $

TYPE=DATA, JUSTIFY=CENTER, COLUMN=Image, IMAGE=(Image),

POSITION=(.01 .01), SIZE=(.16 .18), $

ENDSTYLE

END

 

Here are my images if you want to use them:

greeen_dot.png

red_dot.png

Link to comment
Share on other sites

david.beagan:

 

TABLE FILE ibisamp/ggsales PRINT UNITS DOLLARS COMPUTE Image/A30 = IF UNITS LE 1600 THEN images/red_dot.png ELSE images/green_dot.png; AS Traffic,Light BY CATEGORY WHERE SEQ_NO LE 9 ON TABLE SET PAGE NOLEAD ON TABLE PCHOLD FORMAT &WFFMT.(,,,). ON TABLE SET STYLE * TYPE=REPORT, BORDER=LIGHT, $ TYPE=TITLE, COLOR=WHITE, BACKCOLOR=SILVER, $ TYPE=DATA, JUSTIFY=CENTER, COLUMN=Image, IMAGE=(Image), POSITION=(.01 .01), SIZE=(.16 .18), $ ENDSTYLE END

 

 

Thanks everyone, this is getting me in a better place. Combined with a post I had about a month ago I was able to combine the pieces, and I may finally be coming up with a viable FML traffic light solution. Using this code I was able to get this:

 

TABLE FILE IBISAMP/GGSALES

SUM

GGSALES.SALES01.UNITS

GGSALES.SALES01.DOLLARS

COMPUTE Image/A30 = IF UNITS LE 1000000 THEN images/red_dot.png ELSE images/green_dot.png; AS Traffic,Light

FOR

GGSALES.SALES01.CATEGORY

Coffee AS Coffee LABEL R0100 OVER

Food AS Food LABEL R0200 OVER

Gifts AS Gifts LABEL R0300 OVER

RECAP R1000(1)/P20CB=R0100+R0200+R0300;

AS Total Items OVER

RECAP R1000(3)=IF R1000(1) GT 5000000 THEN images/red_dot.png ELSE IF R1000(1) LT 5000000 THEN images/green_dot.png;

ON TABLE SET PAGE NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET STYLE *

$

TYPE=REPORT,

BORDER-TOP=LIGHT,

BORDER-BOTTOM=LIGHT,

BORDER-LEFT=LIGHT,

BORDER-RIGHT=LIGHT,

$

TYPE=DATA,

COLUMN=N4,

IMAGE=(Image),

SIZE=(0.152778 0.166667),

$

TYPE=TITLE,

COLOR=WHITE,

BACKCOLOR=SILVER,

$

ENDSTYLE

END

Link to comment
Share on other sites

David, as far as the report running and showing an attempt at including an image, yes. We dont have our images under IBFS though, and certainly none that match the categories in GGSALES, so I just assumed that the images would load correctly if theyd exist.

Apparently you can either add a URL or a column to the IMAGE attribute, but not a combination. The documentation says:

TYPE={REPORT|heading}, IMAGE={url|(column)} [,IMAGEALIGN=position]

[,IMAGEBREAK={ON|OFF}] [,ALT=description], $

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...