Hi All,
I am using VA 7.3, is there any way or work around to display the images in VA dashboard. Suppose I selected a employee ID or Name in VA dashboard and I do have his image stored in the database. Now I want to display his/her image in the image object or some other way.
Any help is really appreciated.
Thanks & Regards,
Abhishek Pathak
how many images are we talking about? This number would help determine the approach.
These are the possible solutions. None of this code is tested.
1. transfer images to local file system and display the image using the Image object in VA. This is only practical for a small number of images.
2. transfer images to a WebDav server. Then add a stored process to VA with a parameter for the employee name. The stored process will write HTML code to reference the image on the webDav server.
3. If you want to read the images directly from the database, there your stored process will look something like this,
Libname pics "<to source database>";
proc sql noprint;
create table pics as
select photo as img format=$32767. informat=$32767.
from pics.picstable
where employee="&employee"; /* macr o variable passed from stored process in VA */
quit;
/* transfer image from database to a temporary location that can be referenced by your SAS web server */
/* this will be something like - /opt/sas/config/Lev1/Web/WebServer/htdocs/pics */
data _null_;
set pics;
file "/temp/somewhere on your VA server.jpg" LRECL=32767 NOPRINT NOTAB;
put img;
run;
/* again use HTML to display the picture */
RIchard
Hi,
can you elaborate on "database". Is it a Webdav store? If so then you can display the image using the url reference.
Richard
Hi Richard,
The databases will be like oracle and mssql..
Can you please help out by letting us to know how to display the images using URL( some sort of steps)
Thanks & Regards,
Abhishek Pathak
how many images are we talking about? This number would help determine the approach.
These are the possible solutions. None of this code is tested.
1. transfer images to local file system and display the image using the Image object in VA. This is only practical for a small number of images.
2. transfer images to a WebDav server. Then add a stored process to VA with a parameter for the employee name. The stored process will write HTML code to reference the image on the webDav server.
3. If you want to read the images directly from the database, there your stored process will look something like this,
Libname pics "<to source database>";
proc sql noprint;
create table pics as
select photo as img format=$32767. informat=$32767.
from pics.picstable
where employee="&employee"; /* macr o variable passed from stored process in VA */
quit;
/* transfer image from database to a temporary location that can be referenced by your SAS web server */
/* this will be something like - /opt/sas/config/Lev1/Web/WebServer/htdocs/pics */
data _null_;
set pics;
file "/temp/somewhere on your VA server.jpg" LRECL=32767 NOPRINT NOTAB;
put img;
run;
/* again use HTML to display the picture */
RIchard
Thank you Richard for such a great solution.
The only doubt I am having...using the method propsed, if I am not wrong - I suppose the image will open in seperate browser...is there any way that we can display the image in the VA dashboard itself?
Thanks & Regards,
Abhishek Pathak
yes this is unfortunately correct. And there is also no interactivity possible between a stored process object and another VA object. I think this is VERY easy for SAS to implement. I really hope this is in a next version, then we can make some really nice dashboards using the power of stored processes.
I do not have the knowlegde, but it may be possible for a piece of javascript to 'scrape' the current value of a drop down list for example and then pass this into the stored process..... If you know how to do this I would be grateful to learn how.
Richard
Hi Richard,
I will try to do some R&D on it....if I get some solution definately I will share it.
For the time being may be somebody from community can help us on it..
Thanks & Regards,
Abhishek Pathak
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.