Manoj Chaurasia Posted March 8, 2021 Share Posted March 8, 2021 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 More sharing options...
David Beagan Posted March 8, 2021 Share Posted March 8, 2021 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 More sharing options...
Ben Maxwell Posted March 8, 2021 Author Share Posted March 8, 2021 Im hoping this is an easy one for someone. All Im looking for is the syntax within a Compute Statement to return the following image located under Data Servers > Domains > Common > __beta.jpg. Link to comment Share on other sites More sharing options...
Alban Hertroys Posted March 9, 2021 Share Posted March 9, 2021 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 More sharing options...
Martin Yergeau Posted March 9, 2021 Share Posted March 9, 2021 This is how I call a RS image from a Domain report DEFINE FILE CAR PDF_ICON /A150 = '<IMG SRC="/ibi_apps/run/ibfsIBFS_path=EDA/EDASERVE/logo_img/pdf_small.gif" style="border-style: none;" alt="ASPDF.EVAL">'; END TABLE FILE CAR SUM SEATS PDF_ICON BY COUNTRY END -RUN Link to comment Share on other sites More sharing options...
Ben Maxwell Posted March 9, 2021 Author Share Posted March 9, 2021 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 More sharing options...
Manoj Chaurasia Posted March 9, 2021 Share Posted March 9, 2021 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 More sharing options...
David Beagan Posted March 9, 2021 Share Posted March 9, 2021 Benjamin, we cant see all your code. Put a blank line before the code and then four blanks at the beginning of every line of code. Link to comment Share on other sites More sharing options...
Charles Morris 2 Posted March 9, 2021 Share Posted March 9, 2021 you may want to check your HTMLENCODE setting also if youre using HTML tags Link to comment Share on other sites More sharing options...
David Beagan Posted March 9, 2021 Share Posted March 9, 2021 Alban, I couldnt get the IMAGE=IBFS:/ to work with the COLUMN=. Is the code you posted a working example Link to comment Share on other sites More sharing options...
Martin Yergeau Posted March 9, 2021 Share Posted March 9, 2021 The code tag still work here as it was in FocalPoint much better than adding spaces Without spaces after and before the braces, type the following: [ code ] Paste here your code [ /code ] Link to comment Share on other sites More sharing options...
David Beagan Posted March 10, 2021 Share Posted March 10, 2021 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 More sharing options...
Ben Maxwell Posted March 10, 2021 Author Share Posted March 10, 2021 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 More sharing options...
Alban Hertroys Posted March 10, 2021 Share Posted March 10, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now